WebDriver Chrome Browser: Avoid 'Do you want chrome to save your password' pop up

前端 未结 8 1286
故里飘歌
故里飘歌 2020-12-11 01:07

Every time my webdriver tests login into the application, \'Do you want chrome to save your password\' pop up appears.. Is there a way to avoid this??

Please help.

8条回答
  •  醉话见心
    2020-12-11 01:45

    To provide a more complete picture, here is a working configuration for Watir in a Selenium Grid:

    RSpec.configure do |config|
      config.before :all do
        capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
          chromeOptions: {
              prefs: {
                  'credentials_enable_service': false,
                  'profile': {
                      'password_manager_enabled': false
                  }
              }
          }
        )
    
        @browser = Watir::Browser.new(
          :remote,
          url: "http://#{ENV.fetch('HUB_HOST')}/wd/hub",
          desired_capabilities: capabilities
        )
      end
    
      config.after :all do
        @browser&.close
      end
    end
    

    See a full proof of concept on github at docker-grid-watir.

提交回复
热议问题