While I am navigating the pages using Watir tool, Ramdomly some pop up
appears like 'system is taking care of some request, please wait for
some time'.Once this pop up comes, entire execution stops. The problem
here is, If I know the place where pop would appear I would able to
handle using pop up handler, But this pop is appearing randomly. I think
attachment is goes to that pop up, So it couldn't continue. How would I
resolve this problem.
Normally I'd say deal with the underlying issue. If there's an alert
like that then you should stop the test as a failure.
My approach (in watir-webdriver) was to modify alert.rb to retry
detection several times, allowing for this kind of usage in places where
alerts might or might not appear:
alert.close if alert.exists?(2)
Part of alert.rb:
Another part of alert.rb:
def assert_exists(timer=1) @alert = @target_locator.alert
if @counter >= timer then
raise Exception::UnknownObjectException, 'unable to locate
else @counter += 1
This is code I wrote a long time ago, so I would probably do it
differently now. Still, it might give you some inspiration.
hi, That's a good idea, but what is this alert? this alert is
am not using watir webdriver in my program, I am using Watir though.
If it is a div, then it's probably modal, and will need to be handled in
a different way from the alert.
You would have to find an id or name for the div and then check whether
it is present at each point where it may appear. However, you cannot
simply "close" a div. You need to deal with it via whatever approach you
would use manually.
Retry the URL, click a button in the div... whatever it is you do
My problem is bit different than you explained, The pop up remain for
few seconds and it automatically closes. Once it pop up has been
closed,execution stops. So My problem is not to close the pop up but
continue the execution.