0
package com.sb.testpackage1;

import org.openqa.selenium.Platform;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.remote.DesiredCapabilities;

public class DesiredCapabilitiesDemo {

    public static void main(String[] args) {

        String baseURL = "http://www.google.com";
        WebDriver driver;

        System.setProperty("webdriver.gecko.driver", "C:\\Users\\m12345\\Downloads\\geckodriver-v0.11.1-win64\\geckodriver.exe");       
        DesiredCapabilities caps = DesiredCapabilities.chrome();
        caps.setBrowserName("chrome");
        caps.setPlatform(Platform.WINDOWS);
        driver = new ChromeDriver(caps);

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


    }

}

I am using Selenium 3.0 and the above code is showing the following error

enter image description here

Can any one please point me to resolve this or provide any workarounds. Thanks

sbolla
  • 671
  • 3
  • 22
  • 39
  • http://stackoverflow.com/questions/39922071/selenium-getting-error here is another one similar to this, except trying to launch a IE browser – sbolla Oct 20 '16 at 19:27

1 Answers1

0
    System.setProperty("webdriver.chrome.driver", "C:\\Users\\m12536\\Downloads\\chromedriver_win32\\chromedriver.exe");        
    DesiredCapabilities caps = DesiredCapabilities.chrome();
    caps.setBrowserName("chrome");
    caps.setPlatform(Platform.WINDOWS);
    driver = new ChromeDriver(caps);

    System.setProperty("webdriver.ie.driver", "C:\\Users\\m12354\\Downloads\\IEDriverServer_x64_3.0.0\\IEDriverServer.exe");
    DesiredCapabilities caps = DesiredCapabilities.internetExplorer();
    caps.setBrowserName("internet explorer");
    caps.setPlatform(Platform.WINDOWS);
    driver = new InternetExplorerDriver(caps);

I had the correct driver downloaded and specified the paths correctly

sbolla
  • 671
  • 3
  • 22
  • 39