Print Page | Close Window

Winrunner Function Generator

Printed From: One Stop Testing
Category: Testing Tools @ OneStopTesting
Forum Name: WinRunner @ OneStopTesting
Forum Discription: WinRunner is an automated functional GUI testing tool that allows a user to record and play back UI interactions as test scripts using a proprietary Test Script Language (TSL).
URL: http://forum.onestoptesting.com/forum_posts.asp?TID=7234
Printed Date: 21Dec2024 at 9:43am


Topic: Winrunner Function Generator
Posted By: Mithi25
Subject: Winrunner Function Generator
Date Posted: 26Oct2009 at 1:21am




* Create > Insert Function > For Object/ Window
* Use the pointer to click the # Tickets field.
* The Function Generator opens and suggests the edit_get_text function.
* Change the variable name, text, to tickets and click the Paste button.


* You can use the Function Generator to quickly insert functions into the test script.
* Choose Create > Insert Function > From Function Generator.
* Select the appropriate Category & Function and Paste it.
* Select the object by pointing it and Paste it.


USEFUL FUNCTIONS:

tl_step ( )

By adding tl_ step statements to your test script, you can determine whether a particular operation within the test passed or failed, and send a message to the report.

The function has the following syntax:

tl_step ( step_name, status, description );

step_name the name of the test step.

status sets whether the step passed or failed. Set to 0 for pass, or any

other integer for failure.

Description a short explanation of the step.

In the following example, WinRunner will report in the result window

that the total is incorrect.

tl_step(" total", 1, "Total is incorrect.");

report_msg ( )

You can define a message in your test script and have WinRunner send it to the test results window. To send a message to a test results window, add a

report_msg statement to your test script.

The function has the following syntax:

report_msg ( message );

message A valid string expression.

In the following example, WinRunner gets the value of the label property in the

Flight Reservation window and enters a statement in the test results containing the message and the label value.

win_ get_ info(" Flight Reservation", "label", value);

report_ msg(" The label of the window is " & value);

invoke_application

You can start an application from a WinRunner test script using the invoke_application function.

The invoke_ application function has the following syntax:

invoke_application ( file, command_option, working_dir, show );

file designates the full path of the application to invoke.

command_option parameter designates the command line options to apply.

work_dir designates the working directory for the application

show specifies how the application’s main window appears when open.

For example, the following statement starts the Flight Reservation application and displays it as an icon.

invoke_application(" c:\\ flight1a.exe", "", "", SW_MINIMIZED);


-------------
http://www.quick2sms.com - Send Unlimited FREE SMS to Any Mobile Anywhere in INDIA,
Click Here



Print Page | Close Window