Restart Browser on Failed Step

2 posts, 0 answers
  1. Michael
    Michael avatar
    2 posts
    Member since:
    Sep 2017

    Posted 30 Aug 2018 Link to this post

    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

     

     

  2. Elena
    Admin
    Elena avatar
    1155 posts

    Posted 31 Aug 2018 Link to this post

    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
     
Back to Top