Tuesday, October 28, 2014


In this tutorial, I will show you how to resolve WebDriver Exceptions.

1. Firefox - You may have faced org.openqa.selenium.firefox.NotConnectedException error.

To resolve this error, we need to download new version of Selenium. You can download Selenium from "http:// docs.seleniumhq. org/download/" and then extract the Selenium folder. Add all the JARs files from Selenium folder to your project.


2. Chrome - You may have faced java.lang.IllegalStateException error for chrome.

To resolve this error, You need to download chrome browser driver from "http:// www.seleniumhq. org/download/" and then extract. 







Add few lines of code -

System.setProperty("webdriver.chrome.driver", "D:\\chromedriver.exe");       
WebDriver driver = new ChromeDriver();

3. Internet Explorer - You may have faced java.lang.IllegalStateException error for Internet Explorer.


To resolve this error, You need to download Internet Explorer browser driver from http:// www.seleniumhq. org/download/ and then extract.

Add few lines of code -

        System.setProperty("webdriver.ie.driver", "D:\\IEDriverServer.exe");  
    
        DesiredCapabilities cap
abilities = DesiredCapabilities.internetExplorer();
        cap
abilities.setCapability("ignoreZoomSetting", true);

        WebDriver driver = new InternetExplorerDriver(capabilities);