Most Commonly Used Selenium WebDriver Methods

In this article we are learning the most commonly used selenium webdriver methods.

Important Selenium WebDriver Methods

1. To get the web page of that particular url.

driver.get(“url”);

2. To navigate the particular page of web application.

driver.navigate().to(“url”);

3. It is used for going backward in the browser.

driver.navigate().back();

4. It is used for going forward in the browser.

 driver.navigate().forward();

5. Invoke the driver

System.setProperty(“webdriver.chrome.driver” , “give path of chromedriver file”);

6. For Maximizing Window

driver.manage().window().maximize();

7.  For Minimizing Window

driver.manage().window().minimize();

8. For applying wait or We are providing some time in seconds to hold the screen/web page for some time.

Thread.sleep();

9. For quitting the current window or It is used to closing all tabs and browser and windows associated with the driver.

driver.quite();

10. For closing all window or it is used for closing browser.

driver.close();

11. It is used to reload a webpage.

 driver.navigate().refresh();

12. It is used to retrieve or get the title of the current page. 

driver.getTitle();

13. It is used to retrieve or get the url of the current page. 

driver.getCurrentUrl();

Other Popular Articles

What is implicit Wait, Explicit Wait and Fluent Wait in Selenium WebDriver?

Leave a Comment