Unable to launch chrome browser | Selenium Forum
M
Posted on 23/08/2016
import org.openqa.selenium.*;
import org.openqa.selenium.chrome.*;

public class launchchrome {

public static void main(String[] args) {
System.setProperty("webDriver.chrome.Driver", "C:\\Users\\mubeen\\Desktop\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("http://google.com");
}
}

Issue:
Unable to launch chrome browser. With similar code i was able to launch internet explorer but when i tried to send keys to google search, it was sending each character very very slow. But i tried launching chrome, but getting below error. Request you to please guide.


Error:

Exception in thread "main" org.openqa.selenium.WebDriverException: java.io.IOException: Cannot run program "C:\Users\mubeen\Local Settings\Application Data\Google\Chrome\Application\chrome.exe": CreateProcess error=2, The system cannot find the file specified
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_101'
Driver info: driver.version: chrome
at org.openqa.selenium.chrome.ChromeBinary.start(ChromeBinary.java:55)
at org.openqa.selenium.chrome.ChromeDriver.startClient(ChromeDriver.java:75)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:50)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:60)
at launchchrome.main(launchchrome.java:8)
Caused by: java.io.IOException: Cannot run program "C:\Users\mubeen\Local Settings\Application Data\Google\Chrome\Application\chrome.exe": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
at org.openqa.selenium.chrome.ChromeBinary.start(ChromeBinary.java:41)
... 4 more
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 6 more

M
Replied on 23/08/2016

[color=#FF0000:13z5mkbc]webDriver.chrome.Driver[/color:13z5mkbc]

D is capital

try this
webdriver.chrome.driver


M
Replied on 27/08/2016

I tried "d" as well. It is not working. Even I am not able to launch Firefox. Downloaded 37.0 V
However I am able to launch IE with my code. But when I send keys to search on google. Characters are searched very slowly and is getting timed out. Below my code for Firefox is not working



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


public class launchmozilla {

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

WebDriver driver = new FirefoxDriver();
driver.get("http://google.com");

}

}


Error I get:-

Exception in thread "main" org.openqa.selenium.WebDriverException: java.io.IOException: Cannot run program "C:\Users\mubeen\Local Settings\Application Data\Google\Chrome\Application\chrome.exe": CreateProcess error=2, The system cannot find the file specified
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_101'
Driver info: driver.version: chrome
at org.openqa.selenium.chrome.ChromeBinary.start(ChromeBinary.java:55)
at org.openqa.selenium.chrome.ChromeDriver.startClient(ChromeDriver.java:75)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:50)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:60)
at launchchrome.main(launchchrome.java:8)
Caused by: java.io.IOException: Cannot run program "C:\Users\mubeen\Local Settings\Application Data\Google\Chrome\Application\chrome.exe": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
at org.openqa.selenium.chrome.ChromeBinary.start(ChromeBinary.java:41)
... 4 more
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 6 more


M
Replied on 29/08/2016

you're starting firefox driver and the exception is chrome.exe

something is wrong please check. and try again.