Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start Chromedriver in verbose mode - Selenium Eclipse

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?

like image 458
CustomNet Avatar asked Oct 23 '13 13:10

CustomNet


People also ask

How do I use Chrome driver in headless mode?

Post version 59, Chrome supports headless execution. ChromeOptions class is utilized to modify the default characteristics of the browser. The addArguments method of the ChromeOptions class is used for headless execution and headless is passed as a parameter to that method.

How do I instantiate ChromeDriver?

In order to instantiate the object of ChromeDriver, you can simply create the object with the help of below command. Webdriver driver = New ChromeDriver(); The main motto of the ChromeDriver is to launch Google Chrome. Without that, it is not possible to execute Selenium test scripts in Google Chrome browser.

What is WebDriver ChromeOptions ()?

ChromeOptions is a new concept added in Selenium WebDriver starting from Selenium version 3.6. 0 which is used for customizing the ChromeDriver session. By default when selenium opens up any browser (Chrome browser or Firefox browser), it opens up without any extension or history or cookies, etc.


3 Answers

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.

like image 141
Ted Naleid Avatar answered Oct 03 '22 16:10

Ted Naleid


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

like image 26
CustomNet Avatar answered Oct 03 '22 17:10

CustomNet


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.

like image 33
David Mankellow Avatar answered Oct 03 '22 18:10

David Mankellow