How to suppress "Do you want Google Chrome to save your password for this site"

1,533 views
Skip to first unread message

Michael

unread,
Apr 6, 2017, 6:39:42 AM4/6/17
to robotframework-users

Hi there,

I'm running tests in Google Chrome v57 with the latest selenium webdriver (my config: robotframework 3.0.2, robotframework-selenium2library 1.8.0). When I log into my application the browser opens a nasty box with "Do you want Google Chrome to save your password for this site". Is there a way to configure the user preferences of the driver to not issue this?

I already use this keyword to suppress the info line "Chrome is being controlled by automated test software":

Open Chrome
  [Arguments]  ${alias}=${EMPTY}
 
${options}=   Evaluate   sys.modules['selenium.webdriver'].ChromeOptions()   sys, selenium.webdriver
  Call Method    ${options}    add_argument   disable-infobars  # to suppress "Chrome is being controlled by automated test software" info line
  Create WebDriver  Chrome  alias=${alias}  chrome_options=${options}
 
Go To   ${MY_URL}

Can it be extended to deal with the password issue above?
Also what I see on the web, this isn't the preferred way to get rid of the info line. Is there a better way?

Thank you very much!
Michael


ChromeDoYouWant.png

Reshma Wadkar

unread,
Apr 18, 2017, 5:43:32 AM4/18/17
to robotframework-users
I had face the same problem and solved it using following code

1. U have to create keyword in your python file like this:

   @keyword('SET CHROME OPTION')
   def create_driver():
        profile_val = {"password_manager_enabled": False}
        prefs_val = {"credentials_enable_service": False, 'profile': profile_val}

        chromeOptions = webdriver.ChromeOptions()
            prefs = {"credentials_enable_service": False, 'profile': {  // to handle save password popup
                            'password_manager_enabled': False
                        } }
       chromeOptions.add_argument("disable-infobars") // to suppress "Chrome is being controlled by automated test software" info line
       chromeOptions.add_experimental_option("prefs",prefs)
    
      return chromeOptions

then call this keyword in your robot file like this:

     Create Browser Chrome
        ${chrome_option}=      SET CHROME OPTION
        Create WebDriver  Chrome    chrome_options=${chrome_option}
        Go To    https://www.facebook.com // your site

:Try this it will definitely help you :)

Vitaly C

unread,
Apr 19, 2017, 1:24:05 AM4/19/17
to robotframework-users
Could you please say what imports should be done in python file? RIDE can't import such library file

вторник, 18 апреля 2017 г., 12:43:32 UTC+3 пользователь Reshma Wadkar написал:

Vitaly C

unread,
Apr 19, 2017, 2:00:50 AM4/19/17
to robotframework-users
from robot.api.deco import keyword
from selenium import webdriver

This is imports that needed

среда, 19 апреля 2017 г., 8:24:05 UTC+3 пользователь Vitaly C написал:

Michael

unread,
Apr 19, 2017, 4:56:45 AM4/19/17
to robotframework-users
Thanks for your help, this worked for me.
Reply all
Reply to author
Forward
0 new messages