作为第一次运行,防止watir-webdriver运行chrome [英] prevent watir-webdriver running chrome as a first run

查看:150
本文介绍了作为第一次运行,防止watir-webdriver运行chrome的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次我使用watir-webdriver初始化一个chrome浏览器实例时,它都会以首次运行的方式启动,并弹出EULA弹出窗口并打开一个额外的入门选项卡。



我试图用
$来初始化浏览器b $ b

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

但结果相同。



我很惊讶无法在网上发现任何其他问题,所以假设我做了一些奇怪的事情!



我将chromedriver.exe放入 C:\程序文件(x86)\Google\Chrome\Application

任何想法?

解决方案

我找到了解决方案。在 C:\程序文件(x86)\Google\Chrome\Application 中有一个名为master_preferences的文件。



打开此文件并设置:

require_eula false $ b $ p $ show $ welcome_page to false

p>

解决了这两个问题。



希望这可以帮助别人!


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?

解决方案

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!

这篇关于作为第一次运行,防止watir-webdriver运行chrome的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆