Contributions
Re: Resume test runner script after keyword test fails
I tried that out and it appears to work; by just throwing an error directly from the keyword test, it seems to make it back to the original eval expression. Unfortunately, It appears that I can't get errors to propagate from the onLogError handler. If I try to throw an error from the handler, the error gets logged, but will not hit the catch block associated with the eval expression. I was hoping this could be done to catch unexpected errors such as objects not being found, halt the test and move onto the next one. I'm not sure how you could integrate this into the keyword test itself. I appreciate your help with this.1.3KViews0likes1CommentRe: Resume test runner script after keyword test fails
How do you get the keyword test to raise an exception? The Test Complete 'errors' don't seem to trigger JavaScript errors; I have an error being thrown from the onLogError handler, but the catch block in the test runner routine seems to be ignored. I have read elsewhere thatif the error is raised in another unit the error will be unable to be caught. If it was the keyword test itself raising the exception, I could see that working.1.3KViews0likes3CommentsResume test runner script after keyword test fails
For testing our website, we have designed our test casessuch that they are a series of keyword tests, where every page has a corresponding keyword test. We using Excel-based DDT to read in form entry values, which are then bound to the Keyword test values, and the keyword tests are run in sequence. The sequence of keyword tests is controlled by a Test Runner JavaScript script, as such: eval("KeywordTests." + test + ".Run()"); The issue that arises is that when an error occurs during test execution, such as an object cannot be found, I would like for there to be the option to stop the keyword test completely and move onto the next test. As far as my research into this has gone, it doesn't seem possible. Currently I am able to trap the program flow in an OnLogError event handler. From here I have tried to use the Runner.Stop() method, whichseems to stop the entire test run instead of just the keyword test; as well, I have tried to surround the eval statement with a try/catch block, but it looks like Test Complete intercepts the error before it can make its way back up the call stack. I am hoping to find an alternative solution here. I'm not sure if any of these are feasible, but would it be possible to: Return execution flow from a keyword test called from a script, back to the script, after an error; or Dynamically add Test Items to the Project object to have more fine-grained control from the test runner script; or Some other idea that I haven't thought of. The last ditch solution to this would be to write something like a bash script and call Test Execute for each of the tests, but I am hoping for a more elegant solution.1.3KViews0likes5CommentsResume test runner script after keyword test fails
For testing our website, we have designed our test casessuch that they are a series of keyword tests, where every page has a corresponding keyword test. We using Excel-based DDT to read in form entry values, which are then bound to the Keyword test values, and the keyword tests are run in sequence. The sequence of keyword tests is controlled by a Test Runner JavaScript script, as such: eval("KeywordTests." + test + ".Run()"); The issue that arises is that when an error occurs during test execution, such as an object cannot be found, I would like for there to be the option to stop the keyword test completely and move onto the next test. As far as my research into this has gone, it doesn't seem possible. Currently I am able to trap the program flow in an OnLogError event handler. From here I have tried to use the Runner.Stop() method, whichseems to stop the entire test run instead of just the keyword test; as well, I have tried to surround the eval statement with a try/catch block, but it looks like Test Complete intercepts the error before it can make its way back up the call stack. I am hoping to find an alternative solution here. I'm not sure if any of these are feasible, but would it be possible to: Return execution flow from a keyword test called from a script, back to the script, after an error; or Dynamically add Test Items to the Project object to have more fine-grained control from the test runner script; or Some other idea that I haven't thought of. The last ditch solution to this would be to write something like a bash script and call Test Execute for each of the tests, but I am hoping for a more elegant solution.463Views0likes1Comment