Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do a forced page refresh using selenium webdriver?

In my automation, at one point I have to refresh the page to get the updated page content. But during the refresh the webpage is asking for a confirmation to resend the data (basically an alert is displayed on the page).

Even though I switched the focus to the alert and accepted it, the page contents are not getting refreshed. If I manually do the same, page contents are getting refreshed.

Is there any alternative way to refresh the page using Selenium Webdriver apart from navigate().refresh() command?

Or is there any way I can click on the Retry button on the alert without accepting the alert??

like image 491
sreejith edayillam Avatar asked Dec 06 '11 14:12

sreejith edayillam


1 Answers

In ruby try using this - @driver.switch_to.alert.accept

this will click on Resend

java code driver.switchTo().alert().accept();

like image 135
Amey Avatar answered Dec 10 '22 16:12

Amey