Retry Scope Activity to scrape the Display message

Hi all,
In my workflow, after certain process I have to scrape the display message (used Get Text activity) and then logout from that application.
1.The bot should wait and scrap the message then click the logout button.
2.Sometimes due to connectivity problem the display message takes some time(undefined) to appear but in that case bot without waiting for that message it clicks logout.
3.So I have to put retry scope activity to retry atleast 3 times to scrape the display message.
I even saw some retry scope activity related topics but that didn’t helped and I never used that activity before.
So, plz anyone helps me to solve this issue.

Do you use element exists with a longer TimeoutMS?

If yes have you set the WaitForReady to ‘Complete’?

Are you able to share workflow?

I’m not using element exists becoz every time the message will changes.
In my case i have to check Get Text activity output if that is empty then the bot again tries to scrape the message and the same I want to achieve using retry scope.

Does the window(selector) of the display message change or are you specifically looking for certain text?

So Retry Scope will retry the Action sequence until condition is met for the number of retries you specific and your condition is if your text variable is not blank (you can use the ‘Is True’ Activity.

Inside there your input will be
NOT String.IsNUllOrWhiteSpace(scrapedText)

I’m not looking for any specified text.
It works fine, but even after it tries n times(given in property) to get the text some cases still the message doesn’t appear it throws error so, in that case I have to handle that by using Throw activity (the whole workflow placed within the try catch)?

You can do yes - or if you use the Is True activity in condition of retry scope activity - you can pass out a boolean from there and use a decision after Retry Scope - If true means text found, if false means no text found.

Your get Text activity will fail because if selector is not there it will throw as cannot find selector - you can set it to continue on error = True to prevent that

1 Like

Display message never be empty either it shows success or error message but in case of connection problem it takes some time to display so, I don’t want to logout from the application without the display message.Is there any way to try n times untill the bot get some text.

So you can do as I have suggested:

Retry Scope:

  • Action:
    • Get Text - Set ContinueOnError = True / TimeoutMS = 2500
  • Condition:
    • Is True - Input = NOT String.IsNUllOrWhiteSpace(scrapedText)
      For the properties of Retry Scope:
      Set Timeout to something like 00:00:30
      the number of retries could be like 20

This will equate to a total of 10 minutes waiting for a pop up - if after 10 minutes the pop up has not appeared it will throw an exception. (Retry scope : Action failed to execute as expected.)

Depending on how long you are willing to wait - just increase the timeout / number of retries etc accordingly.

Thanks it works fine!! :+1:

1 Like

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