I\'m trying to test my application on Chrome with ChromeWebDriver but every time I try I get following exception:
org.openqa.selenium.WebDriverException:
I had the same problem as above. Turned out I somehow managed to have two chrome.exe installed. One under Program Files and on under user\appdata\local..... I uninstall the one under Program Files and now it works like a charm.
If you are unable to start your browser in selenium. please ensure whether you set chrome browser as defualt? bcz of this also u may face this "Failed to start your browser" ERROR
I was able to resolve this issue on Windows 10 by using the Administrator CMD to run my scripts.
I have also faced the same issue. I did nothing . I have waited for some 15 mins and run my scripts again. It got worked.
DesiredCapabilities capability = DesiredCapabilities.chrome();
System.setProperty("webdriver.chrome.driver", "path to chromedriver.exe");
capability.setBrowserName("chrome");
capability.setPlatform(PlatformAndEnvironmentSetUp.platformSetUp);
driver = new RemoteWebDriver(new URL("http://" + PlatformAndEnvironmentSetUp.hubIP + ":" + PlatformAndEnvironmentSetUp.hubPort + "/wd/hub"), capability);
this.driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
this.driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
this.driver.manage().window().setSize(new Dimension(1920, 1080));
//page instances init()
loginPage = PageFactory.initElements(this.driver, LoginPage.class);
homePage = PageFactory.initElements(this.driver, AdminHomePage.class);
This sample code works OK for me. Just a little note: "chromedriver.exe" I'm placing in the same project folder. That makes the question of path to chromdriver executable easier.
So this line of code looks in this way:
System.setProperty("webdriver.chrome.driver", "chromedriver.exe");
Resource to download chromedriver.exe
Hope this helps you.
I fixed this on Windows 10 by setting chromedriver.exe, [yourPythonIDE].exe, and chrome.exe to run with Administrator rights, which can reached via right-clicking the exe file and going to Properties >> Compatibility.