Forum Discussion
Hi Thomas,
>> I want to abort the current iteration of the test, and skip to the next one.
If you need to do this, there is only one approach that may help:
1. Divide your JScript that calls keyword tests into several parts: the part that precedes the keyword tests' call and the part that follows it. Save the first part of the script to an individual routine (for example, Test1), and the second part - to another routine (for example, Test2).
2. Open the Test Items editor.
3. Add and enable the following test items:
* Test1
* KeywordTest1
* KeywordTest2
* KeywordTest3
* KeywordTest4
* KeywordTest5
* KeywordTest6
* Test2
4. Add the OnLogError event handler to your test and specify the following code in this handler:
Runner.Stop(true);
5. Disable the Stop on error project property.
6. Run the entire project.
Does this help?
- Jimbo8 years agoOccasional Contributor
Hello,
As of TestComplete 12 the Stop command no longer appears to take an input parameter. I get a jscript error when running this. So instead I tried this:
Runner.Stop();
This stops the entire suite instead of just going to the next keyword test.
So the question remains, how do we skip the remaining steps of one keyword test and go to the next one?
- tristaanogre8 years agoEsteemed Contributor
According to the help, Runner.Stop takes a boolean parameter of either "true" or "false" to indicate whether or not to stop just the current test or the whole suite.
I just tried a Call Object Method operation in a keyword test in a JavaScript project where I passed the parameter "true" to the method and it worked without error.
- Jimbo8 years agoOccasional Contributor
Oh my. This is embarassing.
Not "True" but "true". Notice the lowecase. It works now, thank you.