Unable to run Headless Chrome Browser on Linux Machine using Selenium Webdriver java

539 views
Skip to first unread message

ajay.ko...@gmail.com

unread,
Dec 29, 2017, 7:35:26 AM12/29/17
to ChromeDriver Users
Used Selenium Webdriver(V2.29), selenium-api version(3.4.0), Chrome Version (62.0.3202.94) 64 bit and tried to run chrome browser in linux machine with the below code.

WebDriver driver;
String chromeBinaryPath = "/data/Package/CHROME_NEW";
String driverPath = "/data/Package/Selenium/WebDrivers/ChromeDrivers/chromedriver_linux32/chromedriver";

System.setProperty("webdriver.chrome.driver", driverPath);
System.setProperty("webdriver.chrome.verboseLogging","true");
System.setProperty("webdriver.chrome.logfile","/data/Package/log/chromedriver.log");


ChromeOptions optionsLinux64 = new ChromeOptions();

optionsLinux64.setBinary(chromeBinaryPath);
optionsLinux64.addArguments("--headless");
optionsLinux64.addArguments("--no-sandbox");
optionsLinux64.addArguments("--disable-gpu");

driver = new ChromeDriver(optionsLinux64);
When tried to create a chrome session, getting below exception:

unknown error: Chrome failed to start: exited abnormally (Driver info: chromedriver=2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5),platform=Linux 3.10.0-693.5.2.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 60.10 seconds Build info: version: '3.4.0', revision: 'unknown', time: 'unknown' System info: host: 'el4014.bc', ip: '10.120.94.70', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-693.5.2.el7.x86_64', java.version: '1.8.0_151' Driver info: driver.version: ChromeDriver

Installed Chrome at /data/Package/CHROME_NEW folder using rpm file.

Message in chromedriver.log:

[0.204][DEBUG]: DevTools request: http://localhost:12111/json/version
LaunchProcess: failed to execvp:
/data/Package/CHROME_NEW/
[0.379][DEBUG]: DevTools request failed

Can anyone help me in resolving with the above issue.

John Chen

unread,
Jan 2, 2018, 12:30:43 PM1/2/18
to ajay.ko...@gmail.com, ChromeDriver Users
It looks like chromeBinaryPath is wrong. Maybe try "/data/Package/CHROME_NEW/chrome"?


--
You received this message because you are subscribed to the Google Groups "ChromeDriver Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromedriver-users+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ajay.ko...@gmail.com

unread,
Jan 3, 2018, 12:55:23 AM1/3/18
to ChromeDriver Users
Tried with the above and got the below error.

org.openqa.selenium.WebDriverException: unknown error: no chrome binary at /data/Package/CHROME_NEW/chrome
(Driver info: chromedriver=2.34.522913 (36222509aa6e819815938cbf2709b4849735537c),platform=Linux 3.10.0-693.5.2.el7.x86_64 x86_64) (WARNING: The server did not provie any stacktrace information)
Command duration or timeout: 45 milliseconds
Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T18:33:54.468Z'
System info: host: 'el4014.bc', ip: '10.120.94.70', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-693.5.2.el7.x86_64', java.version: '1.8.0_151'
Driver info: driver.version: ChromeDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:123)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:142)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:181)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:168)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:157)
> To unsubscribe from this group and stop receiving emails from it, send an email to chromedriver-us...@googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



> To unsubscribe from this group and stop receiving emails from it, send an email to chromedriver-us...@googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



> To unsubscribe from this group and stop receiving emails from it, send an email to chromedriver-us...@googlegroups.com.

John Chen

unread,
Jan 3, 2018, 2:02:16 AM1/3/18
to Ajay Chandra, ChromeDriver Users
The error indicates that Chrome couldn't be found at /data/Package/CHROME_NEW/chrome (and previous error indicated that /data/Package/CHROME_NEW wasn't correct either). Please double check exactly where chrome got installed. Also, it might help to try to run Chrome directly from command line first, before attempting to start it from ChromeDriver.

> To unsubscribe from this group and stop receiving emails from it, send an email to chromedriver-users+unsub...@googlegroups.com.
> To unsubscribe from this group and stop receiving emails from it, send an email to chromedriver-users+unsub...@googlegroups.com.
> To unsubscribe from this group and stop receiving emails from it, send an email to chromedriver-users+unsub...@googlegroups.com.

>
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "ChromeDriver Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromedriver-users+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages