Ask a Question

Runner.stop method didn't stop current routine

SOLVED
AbilAjay
Occasional Contributor

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
4 REPLIES 4
rraghvani
Champion Level 3

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.

 

rraghvani_0-1669713408543.png

 

AbilAjay
Occasional Contributor

If we use try catch on test1():

it won't stop, please try that one

AbilAjay_0-1669725709604.png

Hello message is printing

rraghvani
Champion Level 3

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.

AbilAjay
Occasional Contributor

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

cancel
Showing results for 
Search instead for 
Did you mean: