How to start Chromedriver in verbose mode - Selenium Eclipse

和自甴很熟 提交于 2019-12-06 02:40:43

问题


I just installed OSX 10.9 on my mac and ever since then my Chromedriver is not working when I try to run tests.

The error I get is that "chrome was killed".

Everybody keeps mentioning that it works when you set Chromedriver to --verbose mode but I have no idea how to do that.

Any ideas?


回答1:


Here's a script that creates the executable you'll need, cd to the directory where chromedriver is, then paste this into your console:

cat <<EOF>chromedriververbose
echo "running chromedriver --verbose \$*"
\$(dirname \$0)/chromedriver --verbose \$*
EOF

chmod +x chromedriververbose

That'll create an executable script called chromedriververbose that you can point your tests at rather than chromedriver.

Alternatively, you could rename chromedriver to chromedriversilent and then call the above script chromedriver and point it to chromedriversilent for drop-in replacement.




回答2:


To fix this issue, you can download the latest Chromedriver version 2.6 which resolves this issue.

Link - http://chromedriver.storage.googleapis.com/index.html




回答3:


I did the following from within the python console to test the verbose thing:

driver = webdriver.Chrome(service_args=["--verbose"])

It seemed to do the trick. Not ideal but it works for now.




回答4:


You can set command line flags in the capabilities (Java example)

capability = DesiredCapabilities.chrome();
capability.setCapability("chrome.switches",
    Arrays.asList("--verbose"));
webDriver = new RemoteWebDriver(new URL(url), capability);

However I'm not seeing this actually solve the problem on my end, I still get

org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: was killed



来源:https://stackoverflow.com/questions/19543444/how-to-start-chromedriver-in-verbose-mode-selenium-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!