Arth
Arth

Reputation: 13110

prevent watir-webdriver running chrome as a first run

Everytime I use watir-webdriver to initialise a chrome browser instance, it launches as a first-run with an EULA pop-up and an additional getting-started tab open.

Both of these side-effects are preventing me from automating tests for chrome.

I have tried initialising a browser using just

Selenium::WebDriver.for :chrome, :switches => %w[--no-first-run]

but have the same result.

I am surprised to be unable find any other questions online about this, so assume I have done something weird!

I have placed chromedriver.exe in C:\Program Files (x86)\Google\Chrome\Application which is on my PATH variable.

Any ideas?

Upvotes: 1

Views: 508

Answers (2)

Arth
Arth

Reputation: 13110

I have found a solution for this. In C:\Program Files (x86)\Google\Chrome\Application there is a file called master_preferences.

Opening this file and setting:

require_eula to false

show_welcome_page to false

fixed both issues for me.

Hopefully this helps someone!

Upvotes: 2

Alister Scott
Alister Scott

Reputation: 3685

I would put the chromedriver.exe on your PATH, so somewhere like C:/windows/system32 or the like, or you could add the directory C:\Program Files (x86)\Google\Chrome\Application to your PATH (right click My Computer -> Advanced -> Environment Variables)

It should then run OK.

Upvotes: 0

Related Questions