我试图在最新的ubuntu上使用chrome驱动程序运行selenium [java]测试.[16.04]
原文链接:https://www.f2er.com/ubuntu/349194.html我收到以下错误/异常.
作为实验,我用我的原生“helloworldApp”替换了ChromeDriver二进制文件;我发现selenium正在执行我的二进制文件.
我相信在15306端口上打印“启动ChromeDriver 2.27.440175(9bc1d90b8bfa4dd181fbbf769a5eb5e575574320)”来自chrome二进制文件.但为什么硒抱怨它无法获得二进制?
在Windows上一切正常.
请指教.
[java] Starting ChromeDriver 2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320) on port 15306 [java] Only local connections are allowed. [java] Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: cannot find Chrome binary [java] (Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 4.8.0-46-generic x86_64) (WARNING: The server did not provide any stacktrace information) [java] Command duration or timeout: 328 milliseconds [java] Build info: version: 'unknown',revision: 'unknown',time: 'unknown' [java] System info: host: 'geo-VirtualBox',ip: '127.0.1.1',os.name: 'Linux',os.arch: 'amd64',os.version: '4.8.0-46-generic',java.version: '9-internal' [java] Driver info: org.openqa.selenium.chrome.ChromeDriver [java] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(java.base@9-internal/Native Method) [java] at sun.reflect.NativeConstructorAccessorImpl.newInstance(java.base@9-internal/NativeConstructorAccessorImpl.java:62) [java] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(java.base@9-internal/DelegatingConstructorAccessorImpl.java:45) [java] at java.lang.reflect.Constructor.newInstance(java.base@9-internal/Constructor.java:453) [java] at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206) [java] at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158) [java] at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678) [java] at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249) [java] at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131) [java] at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144) [java] at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:170) [java] at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:138)