About Calling Tests - WinRunner

By adding call statements to test scripts, you can create a modular test tree structure containing an entire test suite. A modular test tree consists of a main test that calls other tests, passes parameter values, and controls test execution.

When WinRunner interprets a call statement in a test script, it opens and runs the called test. Parameter values may be passed to this test from the calling test. When the called test is completed, WinRunner returns to the calling test and continues the test run. Note that a called test may also call other tests.

By adding decision-making statements to the test script, you can use a main test to determine the conditions that enable a called test to run.

For example:

rc= call login ("Jonathan", "Mercury");
if (rc == E_OK)
{
call insert_order();
}
else
{
tl_step ("Call Login", 1, "Login test failed");
call open_order ();
}

This test calls the login test. If login is executed successfully, WinRunner calls the insert_order test. If the login test fails, the open_order test runs. You commonly use call statements in a batch test. A batch test allows you to call a group of tests and run them unattended. It suppresses messages that are usually displayed during execution, such as one reporting a bitmap mismatch.

At each break during a test run—such as after a Step command, at a breakpoint, or at the end of a test, you can view the current chain of called tests and functions in the Call Chain pane of the Debug Viewer window. You can also click the Display Test button in the Call Chain pane to display the test that is currently running.

You can also use the Insert Call to QuickTest dialog box or insert a call_ex statement to call a QuickTest test.


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

WinRunner Topics