The treturn and texit statements are used to stop execution of called tests.
Both functions provide a return value for the called test.
treturn
The treturn statement terminates execution of the called test and returns control to the calling test. The syntax is:
treturn [( expression )];
The optional expression is the value returned to the call statement used to invoke the test.
For example:else
treturn("failure");
In the above example, test_a calls test_b. If the bitmap comparison in test_b is successful, then the string “success” is returned to the calling test, test_a. If there is a mismatch, then test_b returns the string “failure” to test_a.
texit
When tests are run interactively, the texit statement discontinues test execution. However, when tests are called from a batch test, texit ends execution of the current test only; control is then returned to the calling
batch test. The syntax is:
texit [( expression )];
The optional expression is the value returned to the call statement that invokes the test.
For example:
# batch testIn the above example, batch_test calls help_test. In help_test, if a particular message appears on the screen, execution is stopped and control is returned to the batch test. Note that the return value of the help_test is also returned to the batch test, and is assigned to the variable return_val.
For more information on batch tests, see “Running Batch Tests.”
|
|
WinRunner Related Tutorials |
|
---|---|
LoadRunner Tutorial | HTML Tutorial |
QTP Tutorial |
WinRunner Related Interview Questions |
|
---|---|
SILK TEST Interview Questions | LoadRunner Interview Questions |
WinRunner Interview Questions | HTML Interview Questions |
QTP Interview Questions | Manual Testing Interview Questions |
OpenStack Interview Questions | Automation Testing Interview Questions |
API testing Interview Questions | Rational robot Interview Questions |
Selenium IDE Interview Questions | Performance Testing Interview Questions |
Test Director Interview Questions |
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.