2013-03-01 75 views
4

在使用水豚进行测试时,我使用Chrome作为默认用户。我想要做的是配置该chrome实例,以便它不会在登录页面上提示记住用户名和密码。在Chrome上配置Selenium - 水豚

我该怎么做?

回答

1

我认为你应该定制Chrome's profile

尝试设置extensions.password_manager_enabled为false:

Capybara.register_driver :chrome do |app| 
    profile = Selenium::WebDriver::Chrome::Profile.new 
    profile['extensions.password_manager_enabled'] = false 
    Capybara::Selenium::Driver.new(app, :browser => :chrome, profile: profile) 
end 

如果它不工作,看其他Chrome的喜好和开关。

+1

我得到这个错误“NameError:未初始化的常量Selenium”我必须包含任何特定的文件吗? – 2013-03-04 07:09:26

+0

@AlperMermer你应该'需要'selenium-webdriver'' – 2013-03-04 07:32:33

+0

profile ['extensions.password_manager_enabled'] = false不起作用。找到这个代码,但它没有工作 profile ['autologin.enabled'] = false – 2013-03-04 12:27:57