Runner.stop method didn't stop current routine
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2022
09:20 PM
11-28-2022
09:20 PM
Runner.stop method didn't stop current routine
I have two routine test1() and test2(), i called test1() inside the test2(), like this
def test1():
Log.error("kaboom")
def test2():
test1():
Log.message("hello")
Play back on error property set to "stop current item"
If I run the test2 it's only stop test1 routine alone it's won't stop test2 it will print hello on the console how i stop the execution of routine test2 completely when there is error occurred? Please someone help me, i try onlog error event aslo it's won't work it's only stop one routine alone
def test1():
Log.error("kaboom")
def test2():
test1():
Log.message("hello")
Play back on error property set to "stop current item"
If I run the test2 it's only stop test1 routine alone it's won't stop test2 it will print hello on the console how i stop the execution of routine test2 completely when there is error occurred? Please someone help me, i try onlog error event aslo it's won't work it's only stop one routine alone
Solved! Go to Solution.
Labels:
- Labels:
-
Script Tests
4 REPLIES 4
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022
01:11 AM
11-29-2022
01:11 AM
See Project Properties - Playback Options. If the option for On error is set to Stop current item, then Log.Error() will cause TC to stop and not continue.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022
04:42 AM
11-29-2022
04:42 AM
If we use try catch on test1():
it won't stop, please try that one
Hello message is printing
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022
07:49 AM
11-29-2022
07:49 AM
Read and understand Errors and Exceptions and Handling Exceptions in Scripts.
You're handling the exception error using the try...except statement. There's nothing in your except statement to indicate that the automation should stop.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022
11:20 PM
11-29-2022
11:20 PM
Thanks, rraghavani now understood, the difference between a test engine (Python Error) error and testcomplete error, Try catch did not handle testcomplete errors like object not found and method not suitable
