小编Jit*_*gid的帖子

无法通过 Heroku 中的 Selenium webdriver(Java) 调用无头 chrome 驱动程序

我在 heroku 环境中调用无头 chrome 并在 WINDOWS(本地机器)中完美运行时遇到了一个问题。

错误:

 2018-02-07T05:37:22.412428+00:00 heroku[web.1]: Starting process with command `java -cp target/classes:target/dependency/* com.appirio.sd.TestScript` 2018-02-07T05:37:24.211467+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.

 2018-02-07T05:37:24.219616+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -Dfile.encoding=UTF-8
 2018-02-07T05:37:24.381460+00:00 app[web.1]: Invoke Browser
 2018-02-07T05:37:24.503816+00:00 app[web.1]: Path: /app/.apt/usr/bin/google-chrome-stable
 2018-02-07T05:37:24.503854+00:00 app[web.1]: Driver Path: agent//chromedriver
 2018-02-07T05:37:24.650636+00:00 app[web.1]: Exception in thread "main" java.lang.IllegalStateException: The driver is not executable: /app/agent/chromedriver
 2018-02-07T05:37:24.650644+00:00 app[web.1]:    at com.google.common.base.Preconditions.checkState(Preconditions.java:534)
 2018-02-07T05:37:24.650650+00:00 app[web.1]:    at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:32)
 2018-02-07T05:37:24.650647+00:00 app[web.1]:    at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:140)
 2018-02-07T05:37:24.650655+00:00 app[web.1]:    at …
Run Code Online (Sandbox Code Playgroud)

java google-chrome heroku selenium-webdriver google-chrome-headless

1
推荐指数
1
解决办法
664
查看次数