Retry scope if page not able to log in for 3 times

how to put retry in UiPath if log in page fails for 3 times
can any one send me help me how can i make this

@T_Y_Raju

Use a retry scope activity

and in condition use element exists with the home page or the page or element you would get when successfully logged in

cheers

iam using Trycatch if page in not able to load or if credentials are incorrect it will go to catch and iam using rethrow and on the top of try catch iam using retry scope is this correct approach

@T_Y_Raju

Yes you can use like this also…thats not an issue

but if you are only rethrowing in catch then you dont need to use try catch only…

cheers

The basics are pretty straightforward. A retry scope is a single activity that:

  • performs al actions/sequences inside its scope
  • catches any exception that occurs or if added, condition that is not met.
  • on any of these errors, instead of throwing the actual system exception, it will first wait for x seconds, and than retry the exact same sequence up to the limit # of attempts.

So in your case you can build a regular log in sequence as a single sequence.
Place the whole into a retry scope and it will execute just once if succesfull, but up to 3 (default) if unsuccesful.

The devil is in the details of course.
Special things to consider:

  • as stated the retry scope does the exact same thing 3 times. So you need to make sure the starting conditions are there for each attempt. Example: if your sequence is to open a browser, navigate to a site, enter credentials and check the login success; then on a failed attempt you might still have your browser open, impeding any second and third attempt. So take care of cleanups.
  • some failures you might not want to repeat. If a password is incorrect, attempting the same action multiple times in a row might cause things like locked accounts. Or simply waste time. An incorrect password will not resolve itself in a retry. A retry scope is best used to capture and resolve parts of automations that are sensitive for application instabilities, not to catch logical errors based on faulty input data. A combination of retry scope and try/catch scenarios and even picl/pick branch constructions can make it really solid, but it takes some practice to get it right.

Start simple. Then add the fancy stuff :smile:

can u build a small flow using try catch and retry scope

@T_Y_Raju

FYI

cheers

Schematically (no direct studio access from here):

retry scope
– try [[ login to application ]]
---- pick
------ branch logged in → success!
-------- assign b_loginSuccess = true
------ branch expired password → throw BE password expired
------ branch anything else → throw SE log fail
– catch SE
---- close browser
---- rethrow SE
– catch BE
---- assign b_loginSuccess = false
---- close browser
– end catch
end retry scope

if b_loginSuccess = false then throw new BE “Password expired”

in catch iam using system exception and retrow activity so once eny error come it will go to retry scope

@T_Y_Raju

Yes exactly…till max retry count is reached it will retry after that error will pop up

cheers

can make this little more clear

can any one send me the above steps in UiPath studio?

can any one send me the above steps in UiPath studio
[/quote]

Hi @T_Y_Raju

You can try any of the below ways:

Retry Scope (Number of Retries: 3)
Action
      Try
        \\ Your login activities here
      Catch
         \\ Handle login failure (optional)
    End Try
Condition
    Element Exists


Retry Scope (Number of Retries: 3)
Action
      Try
        \\ Your login activities here
      Catch
         \\ Handle login failure (optional)
    End Try
Condition
    Check App State


In the Retry Scope set the number of retries to 3 and place your login activities inside the scope. If the login fails, the activities inside the scope will be retried up to three times.

Regards

@T_Y_Raju

Is the screenshot above not sufficient?

Cheers