org.openqa.selenium.firefox.NotConnectedException


1. org.openqa.selenium.firefox.NotConnectedException

This is the common Exception while Opening the Firefox through selenium
To overcome this Problem we must have to use gecko driver and also if
System.setProperty("webdriver.gecko.driver","G:\\Selenium\\Firefox driver\\geckodriver.exe");
  // if above property is not working or not opening the application in browser then try below property

             //System.setProperty("webdriver.firefox.marionette","G:\\Selenium\\Firefox driver\\geckodriver.exe");






import org.openqa.selenium.WebDriver;

import org.openqa.selenium.firefox.FirefoxDriver;



public class Test1 {



      public static void main(String[] args) {


              System.setProperty("webdriver.gecko.driver","G:\\Selenium\\Firefox driver\\geckodriver.exe");
           
              // if above property is not working or not opening the application in browser then try below property

             //System.setProperty("webdriver.firefox.marionette","G:\\Selenium\\Firefox driver\\geckodriver.exe");

            WebDriver driver = new FirefoxDriver();

            driver.get("http://www.facebook.com");

            System.out.println("Application title is ============="+driver.getTitle());

            driver.quit();

Comments

Popular posts from this blog

Write a script to open google.com and verify that title is Google and also verify that it is redirected to google.com