How To Click Browser Button in Selenium Webdriver

How To Click on Browser Button ?
1) Forward Button
How to click on browser forward button in Selenium ?

Forward() Method:
This is predefined method provided by selenium webdriver to click on browser forward button.

driver.navigate().forward();

Selenium code For click on browser forward button Using java

package New;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class AutomationTesting
 {

 public static void main(String[] args)
 {
              // TODO Auto-generated method stub
              System.setProperty("webdriver.chrome.driver","D:\\Sandeep\\Soft\\chromedriver.exe");
              WebDriver drivernew ChromeDriver();
              driver.navigate().to("https://qaacharya.in/");
              driver.manage().window().maximize();
      driver.navigate().forward(); 
              driver.close();

       }
}
2) Back Button 
How to click on browser back button in Selenium ?

back() Method:
This is predefined method provided by selenium webdriver to click on browser back button.

driver.navigate().back();

Selenium code For click on browser back button Using java

package New;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class AutomationTesting
 {

 public static void main(String[] args)
 {
              // TODO Auto-generated method stub
              System.setProperty("webdriver.chrome.driver","D:\\Sandeep\\Soft\\chromedriver.exe");
              WebDriver drivernew ChromeDriver();
              driver.navigate().to("https://qaacharya.in/");
              driver.manage().window().maximize();
      driver.navigate().back(); 
              driver.close();

       }
}
Hope !!! The Above Code For how to click on browser button in Selenium Webdriver  Helpful For You ...
Team 
QA acharya

Tags:How to click on browser button , how to click on browser forward button in Selenium , how to click on forward button in selenium ,How to click on browser button , how to click on browser back button in Selenium , how to click on back button in selenium 
Related Post:



Post a Comment

0 Comments