Dynamically exit a loop

2 posts, 0 answers
  1. Engage QA
    Engage QA avatar
    7 posts
    Member since:
    Apr 2015

    Posted 10 Apr Link to this post

    Hi All,

    I'm trying to find a way to dynamically exit a loop before its completed its number of iterations if a certain even occurs. so logically it need to look something like this ..

    Loop 20 times

    Refresh page

    wait 1sec

        If (Text = bob)

              exit loop 


              Loop count ++

    end loop

    The reason im needing to do this is that we have a cloud service that can 'acceptably' take upto 10mins to process new information if it takes longer than 10mins i want the test to fail, but i don't want the test to wait 10 mins if the data comes back quicker. the data is not pushed to the page but has to be pulled by a page refresh. from the research we've done here we cant find a way to force exit the loop, has anyone done this before? 



  2. Boyan Boev
    Boyan Boev avatar
    1025 posts

    Posted 13 Apr Link to this post

    Hello Dan,

    For this purposes it is better to use While conditional step

    In this case Test Studio will loop until some verification condition fails.

    Let me know if that helps.

    Boyan Boev
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top