Test Script Testing Options - WinRunner

This section describes the WinRunner testing options that can be used with the setvar and getvar functions from within a test script. If you can also use set or view the corresponding option from a dialog box, it is indicated below.

attached_text_area

This option specifies the location on a GUI object from which WinRunner searches for its attached text.

Possible values:

Note:All of the above possible values are text strings.

You can use this option with the setvar and getvar functions.

You can also set this option using the Attached Text - Preferred search area box in the Record category of the General Options dialog box as described in “Setting Recording Options”

Notes:

When you run a test, you must use the same values for the attached text options that you used when you recorded the test. Otherwise, WinRunner may not identify the GUI object.

In previous versions of WinRunner, you could not set the preferred search area: WinRunner searched for attached text based on what is now the Default setting for the preferred search area. If backward compatibility is important, choose the Default setting.

attached_text_search_radius

This option specifies the radius from the specified location on a GUI object that WinRunner searches for the static text object that is its attached text.

Possible values: 3 - 300 (pixels)

You can use this option with the setvar and getvar functions.

You can also set this option using the Attached Text - Search radius box in the Record category of the General Options dialog box as described in “Setting Recording Options”

Note:When you run a test, you must use the same values for the attached text options that you used when you recorded the test. Otherwise, WinRunner may not identify the GUI object.

Batch

This option displays whether WinRunner is running in batch mode. In batch mode, WinRunner suppresses messages during a test run so that a test can run unattended. WinRunner also saves all the expected and actual results of a test run in batch mode in one folder, and displays them in one Test Results window. For more information on the batch testing option, see “Running Batch Tests.”

For example, if a set_window statement is missing from a test script, WinRunner cannot find the specified window. If this option is on and the test is run in batch mode, WinRunner reports an error in the Test Results window and proceeds to run the next statement in the test script. If this option is off and the test is not run in batch mode, WinRunner pauses the test and opens the Run wizard to enable the user to locate the window. You can use this option with the getvar function.

Possible values: on, off (text strings)

You can also set this option using the Run in batch mode check box in the Run category of the General Options dialog box as described in “Setting Test Run Options”

Note that you can also set this option using the corresponding –batch command line option, described in “Running Tests from the Command Line.”

beep

This option determines whether WinRunner beeps when checking any window during a test run.

You can use this option with the setvar and getvarfunctions.

Possible values: on, off (text strings)

You can also set this option using the corresponding Beep when checking a window check box in the Run > Settings category of the General Options dialog box as described in “Setting Run Setting Options”

Note that you can also set this option using the corresponding –beep command line option, described in “Running Tests from the Command Line.”

capture_bitmap

This option determines whether WinRunner captures a bitmap whenever a checkpoint fails. When this option is on, WinRunner uses the settings from the Run > Settings category of the General Options dialog box to determine the captured area for the bitmaps.

You can use this option with the setvar and getvar functions.

Possible values: on, off (text strings)

You can also set this option using the Capture bitmap on verification failure check box in the Run > Settings category of the General Options dialog box, as described in “Setting Run Setting Options”

Note that you can also set this option using the corresponding -capture_bitmap command line option, described in “Running Tests from the Command Line.”

cs_fail

This option determines whether WinRunner fails a test when Context Sensitive errors occur. A Context Sensitive error is the failure of a Context Sensitive statement during a test. Context Sensitive errors are often due to WinRunner’s failure to identify a GUI object.

For example, a Context Sensitive error will occur if you run a test containing a set_window statement with the name of a non-existent window. Context Sensitive errors can also occur when window names are ambiguous.

You can use this option with the setvar and getvar functions.

Possible values: 1,0

You can also set this option using the corresponding Fail test when Context Sensitive errors occur check box in the Run > Settings category of the General Options dialog box as described in “Setting Run Setting Options”

You can also set this option using the corresponding -cs_fail command line option, described in “Running Tests from the Command Line.”

cs_run_delay

This option sets the time (in milliseconds) that WinRunner waits between executing Context Sensitive statements when running a test.

You can use this option with the setvar and getvar functions.

Possible values: numbers 0 and higher

You can also set this option using the corresponding Delay between execution of CS statements box in the Run > Synchronization category of the General Options dialog box as described in “Setting Run Synchronization Options”

Note that you can also set this option using the corresponding -cs_run_delay command line option, described in “Running Tests from the Command Line.”

curr_dir

This option displays the current working folder for the test. You can use this option with the getvar function.

You can also view the location of the current working folder for the test from the corresponding Current folder box in the Current Test tab of the Test Properties dialog box, described in “Reviewing Current Test Settings”

delay_msec

This option sets the sampling interval (in seconds) used to determine that a window is stable before capturing it for a Context Sensitive checkpoint or synchronization point. To be declared stable, a window must not change between two consecutive samplings. This sampling continues until the window is stable or the timeout (as set with the timeout_msec testing option) is reached. (Formerly delay, which was measured in seconds.)

For example, when the delay is two seconds and the timeout is ten seconds, WinRunner checks the window in the application under test every two seconds until two consecutive checks produce the same results or until ten seconds have elapsed. Setting the value to 0 disables all bitmap checking. You can use this option with the setvar and getvar functions.

Possible values: numbers 0 and higher

Note:This option is accurate to within 20-30 milliseconds.

You can also set this option using the corresponding Delay for window synchronization option in the Run > Synchronization category of the General Options dialog box as described in “Setting Run Synchronization Options”

Note that you can also set this option using the corresponding -delay_msec command line option, described in “Running Tests from the Command Line.”

drop_sync_timeout

determines whether WinRunner minimizes the synchronization timeout (as defined in the timeout_msec option) after the first synchronization failure.

Possible values: on, off (text strings)

You can use this option with the getvar and setvar functions.

You can also set this option using the corresponding Drop synchronization timeout if failed check box in the Run > Synchronization category of the General Options dialog box as described in “Setting Run Synchronization Options”

email_service

This option determines whether WinRunner activates the e-mail sending options including the e-mail notifications for checkpoint failures, test failures, and test completed reports as well as any email_send_msg statements in the test.

Possible values: on, off (text strings)

You can use this option with the getvar and setvar functions.

You can also set this option using the corresponding Activate e-mail service check box in the Notifications > E-mail category of the General Options dialog box as described in “Setting E-mail Notification Options”

Note that you can also set this option using the corresponding -email_service command line option, described in “Running Tests from the Command Line.”

enum_descendent_toplevel

This option determines whether WinRunner records controls (objects) of a child object whose parent is an object but not a window and identifies these controls when running a test.

Possible values: 1,0

You can use this option with the getvar and setvar functions.

You can also set this option using the corresponding Consider child windows check box in the Record category of the General Options dialog box as described in “Setting Recording Options”

exp

This option displays the full path of the expected results folder associated with the current test run.

You can use this option with the getvar function.

You can also view the full path of the expected results folder from the corresponding Expected results folder box in the Current Test tab of the Test Properties dialog box as described in “Reviewing Current Test Settings”

Note that you can also set this option using the corresponding –exp command line option, described in “Running Tests from the Command Line.”

fontgrp

To be able to use Image Text Recognition (instead of the default Text Recognition), (described in “Setting Text Recognition Options”), you must choose an active font group. This option sets the active font group for Image Text Recognition. For more information on font groups, see “Teaching Fonts to WinRunner” You can use this option with the setvar and getvar functions.

Possible values: any text string

You can also set this option using the corresponding Font group box in the Record > Text Recognition category of the General Options dialog box as described in “Setting Text Recognition Options”

Note that you can also set this option using the corresponding –fontgrp command line option, described in “Running Tests from the Command Line.”

item_number_seq

This option defines the string recorded in the test script to indicate that a List, ListView, or TreeView item is specified by its index number. You can use this option with the setvar and getvar functions.

Possible values: any text string

You can also set this option using the corresponding String indicating that what follows is a number box in the Record > Script Format category of the General Options dialog box as described in “Setting Script Format Options”

key_editing

This option determines whether WinRunner generates more concise type, win_type, and obj_type statements in a test script.

When this option is on, WinRunner generates more concise type, win_type, and obj_type statements that represent only the net result of pressing and releasing input keys. This makes your test script easier to read.

For example:

obj_type (object, "A");

When this option is disabled, WinRunner records the pressing and releasing of each key. For example:

obj_type (object, "<kShift_L>-a-a+<kShift_L>+");

Disable this option if the exact order of keystrokes is important for your test.

You can use this option with the setvar and getvar functions.

Possible values: on, off (text strings)

You can also set this option using the corresponding Generate concise, more readable type statements check box in the Record > Script Format category of the General Options dialog box as described in “Setting Script Format Options”

line_no

This option displays the line number of the current location of the execution arrow in the test script.

You can use this option with the getvar function.

You can also view the current line number in the test script from the corresponding Current line number box in the Current Test tab of the Test Properties dialog box, described in “Reviewing Current Test Settings”

List_item_separator

This option defines the string recorded in the test script to separate items in a list box or a combo box.

You can use this option with the setvar and getvar functions.

Possible values: any text string

You can also set this option using the corresponding String for separating ListBox or ComboBox items box in the Record > Script Format category of the General Options dialog box as described in “Setting Script Format Options”

Listview_item_separator

This option defines the string recorded in the test script to separate items in a ListView or a TreeView.

You can use this option with the setvar and getvar functions.

Possible values: any text string

You can also set this option using the corresponding String for separating ListView or TreeView items box in the Record > Script Format category of the General Options dialog box as described in “Setting Script Format Options”

min_diff

This option defines the number of pixels that constitute the threshold for bitmap mismatch. When this value is set to 0, a single pixel mismatch constitutes a bitmap mismatch.

You can use this option with the setvar and getvar functions.

Possible values: numbers 0 and higher

You can also set this option using the corresponding Threshold for difference between bitmaps box in the Run > Settings category of the General Options dialog box as described in “Setting Run Setting Options”

Note that you can also set this option using the corresponding -min_diff command line option, described in “Running Tests from the Command Line.”

mismatch_break

This option determines whether WinRunner pauses the test run and displays a message whenever verification fails or whenever any message is generated as a result of a context sensitive statement during a test that is run in Verify mode. This option should be used only when working interactively.

For example, if a set_window statement is missing from a test script, WinRunner cannot find the specified window. If this option is on, WinRunner pauses the test and opens the Run wizard to enable the user to locate the window. If this option is off, WinRunner reports an error in the

Test Results window and proceeds to run the next statement in the test script.

You can use this option with the setvar and getvar functions.

Possible values: on, off (text strings)

You can also set this option using the corresponding Break when verification fails check box in the Run > Settings category of the General Options dialog box as described in “Setting Run Setting Options”

Note that you can also set this option using the corresponding -mismatch_break command line option, described in “Running Tests from the Command Line.”

rec_item_name

This option determines whether WinRunner records non-unique ListBox and ComboBox items by name or by index.

You can use this option with the setvar and getvar functions.

Possible values: 1,0

You can also set this option using the corresponding Record non-unique list items by name check box in the Record category of the General Options dialog box as described in “Setting Recording Options”

Note that you can also set this option using the corresponding -rec_item_name command line option, described in “Running Tests from the Command Line.”

rec_owner_drawn

Since WinRunner cannot identify the class of owner-drawn buttons, it automatically maps them to the general “object” class. This option enables you to map all owner-drawn buttons to a standard button class (push_button, radio_button, or check_button).

You can use this option with the setvar and getvar functions.

Possible Values: object, push_button, radio_button, check_button (text strings)

You can also set this option using the corresponding Record owner-drawn buttons as box in the Record category of the General Options dialog box as described in “Setting Recording Options”

result

This option displays the full path of the verification results folder associated with the current test run.

You can use this option with the getvar function.

You can also view the full path of the verification results folder from the corresponding Verification results folder box in the Current Test tab of the Test Properties dialog box as described in “Reviewing Current Test Settings”

runmode

This option displays the current run mode.

You can use this option with the getvar function.

Possible values: verify, debug, update (text strings)

You can also view the current run mode from the corresponding Run mode box in the Current Test tab of the Test Properties dialog box, described in “Reviewing Current Test Settings”

searchpath

This option sets the path(s) in which WinRunner searches for called tests. If you define search paths, you do not need to designate the full path of a test in a call statement. You can set multiple search paths in a single statement by leaving a space between each path. To set multiple search paths for long file names, surround each path with angle brackets < >. WinRunner searches for a called test in the order in which multiple paths appear in the getvar or setvar statement.

You can use this option with the setvar and getvar functions.

You can also set this option using the corresponding Search path for called tests box in the Folders category of the General Options dialog box as described in “Setting Folder Options”

Note that you can also set this option using the corresponding -search_path command line option, described in “Running Tests from the Command Line.”

NoteWhen WinRunner is connected to TestDirector, you can specify the paths in a TestDirector database that WinRunner searches for called tests. Search paths in a TestDirector database can be preceded by [TD].

shared_checklist_dir

This option designates the folder in which WinRunner stores shared checklists for GUI and database checkpoints. In the test script, shared checklist files are designated by SHARED_CL before the file name in a win_check_gui, obj_check_gui, check_gui, or check_db statement. For more information on shared GUI checklists, see “Saving a GUI Checklist in a Shared Folder” For more information on shared database checklists, see “Saving a Database Checklist in a Shared Folder” Note that if you designate a new folder, you must restart WinRunner in order for the change to take effect.

You can use this option with the getvar function.

You can also view the location of the folder in which WinRunner stores shared checklists from the corresponding Shared checklists box in the Folders category of the General Options dialog box as described in “Setting Folder Options”

silent_mode

This option displays whether WinRunner is running in silent mode. In silent mode, WinRunner suppresses messages during a test run so that a test can run unattended. When you run a test remotely from TestDirector, you must run it in silent mode, because no one is monitoring the computer where the test is running to view the messages. For information on running tests remotely from TestDirector, see “Managing the Testing Process.”

You can use this option with the setvar and getvar functions.

Possible values: on, off (text strings)

Note:When you run tests in batch mode, you automatically run them in silent mode. For information running tests in batch mode, see Chapter 35, “Running Batch Tests.

single_prop_check_fail

This option fails a test run when _check_info statements fail. It also writes an event to the Test Results window for these statements. (You can create _check_info statements using the Insert > GUI Checkpoint > For Single Property command.)

You can use this option with the setvar and getvar functions.

Possible values: 1,0

You can also set this option using the corresponding Fail test when single property check fails option in the Run > Settings category of the General Options dialog box as described in “Setting Run Setting Options”

Note that you can also set this option using the corresponding -single_prop_check_fail command line option, described in “Running Tests from the Command Line.”

speed

This option sets the default run speed for tests run in Analog mode.

Possible values: normal, fast (text strings)

Setting the option to normal runs the test at the speed at which it was recorded.

Setting the option to fast runs the test as fast as the application can receive input.

You can use this option with the setvar and getvar functions. You can also set this option using the corresponding Run speed for Analog mode option in the Run category of the General Options dialog box as described in “Setting Test Run Options”

Note that you can also set this option using the corresponding –speed command line option, described in “Running Tests from the Command Line.”

sync_fail_beep

This option determines whether WinRunner beeps when synchronization fails.

You can use this option with the setvar and getvar functions.

Possible values: 1,0

You can also set this option using the corresponding Beep when synchronization fails check box in the Run > Synchronization category of the General Options dialog box as described in “Setting Run Synchronization Options”

NoteThis option is useful primarily for debugging test scripts.

NoteIf synchronization often fails during your test runs, consider increasing the value of the synchronization_timeout testing option (described below) or the corresponding Timeout for waiting for synchronization message option in the Run > Synchronization category of the General Options dialog box.

synchronization_timeout

This option sets the timeout (in milliseconds) that WinRunner waits before validating that keyboard or mouse input was entered correctly during a test run.

You can use this option with the setvar and getvar functions.

Possible values: numbers 0 and higher

You can also set this option using the corresponding Timeout for waiting for synchronization message box in the Run > Synchronization category of the General Options dialog box as described in “Setting Run Synchronization Options”

NoteIf synchronization often fails during your test runs, consider increasing the value of this option.

td_connection

This option indicates whether WinRunner is currently connected to

TestDirector. (Formerly test_director.)

You can use this option with the getvar function.

Possible values: on, off (text strings)

You can connect to TestDirector from the TestDirector Connection dialog box or using the -td_connection command line option. For more information about connecting to TestDirector, see “Managing the Testing Process.”

td_cycle_name

This option displays the name of the TestDirector test set (formerly known as “cycle”) for the test. (Formerly cycle.)

You can use this option with the getvar function.

You can set this option using the Run Tests dialog box when you run a test set from WinRunner while connected to TestDirector. For more information, see “Running Tests in a Test Set”. You can also set this option from within TestDirector. For more information, refer to the TestDirector User’s Guide.

Note that you can also set this option using the corresponding -td_cycle_name command line option, described in “Running Tests from the Command Line.”

td_database_name

This option displays the name of the TestDirector project database to which WinRunner is currently connected.

You can use this option with the getvar function.

You can set this option using the Project option in the TestDirector Connection dialog box, which you can open by choosing Tools > TestDirector Connection. For more information, see “Managing the Testing Process.”

Note that you can also set this option using the corresponding -td_database_name command line option, described in “Running Tests from the Command Line.”

td_server_name

This option displays the name of the TestDirector server (TDAPI) to which WinRunner is currently connected.

You can use this option with the getvar function.

You can set this option using the Server box in the TestDirector Connection dialog box, which you can open by choosing Tools > TestDirector Connection. For more information, see “Managing the Testing Process.”

Note that you can also set this option using the corresponding -td_server_name command line option, described in “Running Tests from the Command Line.”

td_user_name

This option displays the user name for opening the selected TestDirector database. (Formerly user.)

You can use this option with the getvar function.

Note that you can also set this option using the corresponding -td_user_name command line option, described in “Running Tests from the Command Line.”

You can set this option using the User name box in the TestDirector Connection dialog box, which you can open by choosing Tools > TestDirector Connection. For more information, see “Managing the Testing Process.”

tempdir

This option designates the folder containing temporary files. Note that if you designate a new folder, you must restart WinRunner in order for the change to take effect.

You can use this option with the setvar and getvar functions.

You can also set this option using the corresponding

Temporary files box in the Folders category of the General Options dialog box as described in “Setting Folder Options.”

testname

This option displays the full path of the current test.

You can use this option with the getvar function.

You can also view the location and the test name of the current test in the General tab of the Test Properties dialog box as described in “Documenting General Test Information”

timeout_msec

This option sets the global timeout (in milliseconds) used by WinRunner when executing checkpoints and Context Sensitive statements. This value is added to the time parameter embedded in GUI checkpoint or synchronization point statements to determine the maximum amount of time that WinRunner searches for the specified window. The timeout must be greater than the delay for window synchronization (as set with the delay_msec testing option). (Formerly timeout, which was measured in seconds.)

For example, in the statement:

win_check_bitmap ("calculator", Img1, 2, 261,269,93,42);

when the timeout_msec variable is 10,000 milliseconds, this operation takes a maximum of 12,000 (2,000 +10,000) milliseconds.

You can use this option with the setvar and getvar functions.

Possible values: numbers 0 and higher

Note:This option is accurate to within 20-30 milliseconds.

You can also set this option using the corresponding Timeout for checkpoints and CS statements box in the Run > Settings category of the General Options dialog box as described in “Setting Run Setting Options”

Note that you can also set this option using the corresponding -timeout_msec command line option, described in “Running Tests from the Command Line.”

Treeview_path_separator

This option defines the string recorded in the test script to separate items in a tree view path.

Possible values: any text string

You can use this option with the getvar and setvar functions.

You can also set this option using the corresponding String for parsing a TreeView path box in the Record > Script Format category of the General Options dialog box as described in “Setting Script Format Options”


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

WinRunner Topics