How to break out from retry scope activity?

Hi there,

I am working on a website.
For login, I have added retry scope.
So (attach browser, Enter Username, Enter Password, Click login) is in retry scope and condition in retry scope is element exist(timeout is increased) from the Home page. It’s working fine.

If the username or password is wrong that it gives error on the login page and doesn’t navigate to the Home page. But as the entire activities are in retry scope it again attempts to log in with wrong credentials.

How can I break out of retry scope if conditions like above occurs?

You can give the number of retires and time interval for each retires.

If retire number given 2 so after the second attempt it will come out from Retry scope.

Thanks
@Iqr

@Iqr
you can split:
For login: Attach browser waiting for the login form Retry scope 1
Enter login credentials
Element exists if browser is still on login page (I assume e.g. an error message or anything else)
If not then use second retry scope for synchronizing with the Home page

wrapping retry scope into a try catch is not advisable as it is equalizing the exceptions and does loose the differentation.

What we did often was setting up a custom retry scope:

  • for each activity with Enumerable.Range(1,NoOfRetries).toList
  • implementing the custom condition check and using break activity for ending the loop
  • delay activity
  • optional: throwing error
2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.