Login with Exception when is not working

Hello,
I’m creating a login sequence for a website. It must attempt three attempts if it fails.

How can I check if the login failed?. And if it fails, how can I set up three login retries, and if the last retry fails, throw the exception I created?.

Thanks

Hi @Vanesa_Garcia_R

You can use the retry scope activity ,

Here, mention the number of retries count 3, action sequence add the login steps, in condition indicate the home page,

then after 3 retries home page not appear throw exception

Regards,
Gowtham K

Put your Login code into Retry method.

Please use element exists with if condition.. if it fails to log a message.

hope my inputs are useful.

Hi @Vanesa_Garcia_R

You can make use of Check App State Activity within the the condition of the Retry scope Activity and in the check app sate you can point to Any selector within login window itself.
Make sure to make the No. of Retries to 3 in properties panel of retry scope
If you want to throw a custom exception message surround the retry scope with a try catch and in catch you can again throw the exception New systemException("Your Custom Exception")

Hope this helps!
Happy Automation :innocent:

1 Like

Hi @Vanesa_Garcia_R

use a while loop with a counter set to 3, inside try to login, use an if activity to check for login failure by detecting an error message or missing element, if failed increment counter and retry, if after 3 attempts still fails use throw activity to raise your custom exception.

If helpful, mark as solution. Happy automation with UiPath! :white_check_mark:

Thank you so much for your answer. It was correct, but I needed more detailed explanations.

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