Refresh browser using selenium

0 votes
Except sendkeys(keys.F5);

Are there other ways to refresh the browser using selenium commands?
Jan 8, 2019 in Selenium by Anjali
• 2,950 points
936 views

Try using this method if you are using JS Executor:

driver.executeScript("location.reload();");

3 answers to this question.

0 votes
You can use navigate().refresh(). This works fine.
answered Jan 8, 2019 by Disha
0 votes
Try using getCurrentUrl().
answered Jan 8, 2019 by Trisha
+1 vote
Try navigate().to(driver.getCurrentUrl()). Works like charm.
answered Jan 8, 2019 by Mohan
driver.navigate().refresh();
@Harish, yeah that works fine for me.

Related Questions In Selenium

0 votes
1 answer

How can I refresh a browser window in different ways using Selenium Webdriver?

Hello Piyush, you can refresh a browser ...READ MORE

answered May 29, 2019 in Selenium by Anvi
• 14,150 points
2,895 views
0 votes
1 answer

Need to perform parallel execution (multiple browser sessions) with Selenium & TestNG by using @BeforeSuite

@Beforesuite annotated method runs before the testNG.XML ...READ MORE

answered Mar 30, 2018 in Selenium by nsv999
• 5,500 points
5,387 views
0 votes
1 answer
0 votes
1 answer
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
12,619 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
8,572 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,910 points
6,629 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,519 views
0 votes
1 answer

What are the different components of Selenium?

Selenium is a testing tool and comprises ...READ MORE

answered Jan 8, 2019 in Selenium by Fuji
1,248 views
0 votes
1 answer

Different API for selenium

Hey @User, there is this list that ...READ MORE

answered Jan 8, 2019 in Selenium by Fuji
418 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP