How to open Firefox Browser Using Gecko Driver












package mypackagefirefox;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class Firefox {

 public static void main(String[] args) {
  // TODO Auto-generated method stub

  
  //Set the path of the driver
  String exepath = "C:\\Users\\mn\\Downloads\\geckodriver-v0.19.1-win64//geckodriver.exe";
  System.setProperty("webdriver.gecko.driver", exepath);
  
  WebDriver driver = new FirefoxDriver ();
  
  //Open URL
  driver.get("http://www.testingtreasure.com");
  
  
 }

}


2 comments: