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?.
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")
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!