This is a migrated thread and some comments may be shown as answers.

Restart Browser on Failed Step

1 Answer 43 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Michael
Top achievements
Rank 1
Michael asked on 30 Aug 2018, 02:05 PM

I'm creating a data driven test.

Simple steps:

1. Navigate to page.
2. Login
3. Click link
4. Fill in text fields
5. Click save
6. Logout

If all steps complete without failing, each record in the data is executed correctly. However, if step 4 fails, test studio goes to the next record in the data and starts back to step 1. However, because the system is already logged in, and the logout has not occurred, step 2 cannot be completed because those fields don't exist.

 

My first thought is... can test studio upon step failure close and restart the browser, which effectively logs you out of the system. Or, is there a way to run a step, such as step 6 logout on failures?

Thanks,

Michael

 

 

1 Answer, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 31 Aug 2018, 12:38 PM
Hello Michael,

Thank you for sharing details for your requirements. 

Test Studio provides you the feature to clear the browser cache which you could implement at the beginning of each iteration - I guess this will be working fine for this scenario. 

Another option you could give a try to is to implement the login actions in a if...else statement. The condition to verify could be if the Logout button exists on current page and then decide how to proceed - if it exists click it and then login else directly login. 

It will be even more consistent f you decide to use the Login button existence to decide how to proceed - if it exists proceed further else click Logout. That way the Login actions will be used only once in the test after the if...else statement. 

I hope any of these will be helpful for you. Please let me know if you have any questions. Thanks! 

Regards,
Elena Tsvetkova
Progress Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
Michael
Top achievements
Rank 1
Answers by
Elena
Telerik team
Share this question
or