A try catch perhaps?

I am using the web side of test project. I set up the steps to login and then do stuff and then log out. If the test fails for some reason, I still want to run the log out step so that when the next test runs and looks for the login button it finds it.
Can I run an additional step on test failure?

Im no expert on TestProject, but from what I know, in every step, under ‘Advanced Options’, there’s an option to handle errors, ‘How to Act if the Step Fails’, like so:
image

From what I understand, this is TestProject’s closest equivalent to ‘try-catch’.

Normally, my scripts clicks on a button → a popup window appears → the scripts tries to select the data listed in the popup → which leads to the popup automatically closing → proceed as normal

But sometimes, there’s no data in the popup window to select due to reasons(which will lead to the popup not closing, hence the test failing), so what happens here is that if the initial script fails to select the expected data in the popup, it will run a separate script (Close Popup) to close the popup window, thus allowing the initial script to run as normal.
Thus far, this has been working fine for me.

In your case, depending on where you put the logout step, instead of selecting ‘Recovery Test’, you could perhaps select ‘Continue Test’ to do what you need.

1 Like