How to open browser 3 times in case it does not respond

Hello guys, I need to catch if a web page does not respond and try to open it again (3 times max) in case it does not do so. I know that I can use the Retry scope activity but the problem is that it opens the web page 3 times and I need a way to close it when the web page does not respond (open, does not respond, close it, retry, open, does not respond, close it, retry, open, does not respond, close it). I have tried in two ways which are:

imagen
Here the problem is that the web page never closes

imagen
imagen
The problem here is that the web page closes at the first try when it does not respond

Any hint would be helpful :slight_smile:

Btw, I am using the reframework, after the third try I need to send an error email and all the process will end

Hi @ahzaradsh




Try with this

interesting approach, the problem with this is however that it does not “reload” the web page i.e closes it and tries to open it again (what i am trying to do is to simulate what happens when i am not able to get into the web page for whatever reason like the web page going down or anything else and try to reload it maximum 3 times)

@ahzaradsh

You can use retry scope as below

Check if the window is already open using element exists/check app state if it is open then use refresh if it is not open use open browser…

Hope this helps

Cheers

Hello @ahzaradsh

You can easily do it using a while loop and some conditions.

‘i’ is an interger variable with default value as ‘0’

Thanks

It did help me to achieve what I was looking for, thanks Rahul!

1 Like

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