Interview Questions

What is the use of treturn and texit statements in the test script?

Mercury WinRunner FAQ


(Continued from previous question...)

What is the use of treturn and texit statements in the test script?

The treturn and texit statements are used to stop execution of called tests.
i. The treturn statement stops the current test and returns control to the calling test.
ii. The texit statement stops test execution entirely, unless tests are being called from a batch test. In this case, control is returned to the main batch test.
Both functions provide a return value for the called test. If treturn or texit is not used, or if no value is specified, then the return value of the call statement is 0.
The syntax is:
treturn [( expression )];
texit [( expression )];

(Continued on next question...)

Other Interview Questions