How to enable password saving in Chrome run by Capybara through Selenium?

Multi tool use
Multi tool use


How to enable password saving in Chrome run by Capybara through Selenium?



I wrote a test using Capybara that checks whether Chrome's auto-fill feature works correctly for my web application's login form. If running the web application in the browser and saving the password after registration, Chrome automatically fills the login form. However for the automated test, I didn't find a way to make Chrome save the password of the registration form that's been entered by Capybara/Selenium. It seems like the popup for this isn't even shown. Is there a way to enable the saving of passwords?




1 Answer
1



You can try this:


Capybara.register_driver :selenium do |app|
preferences = {credentials_enable_service: true,
password_manager_enabled: true}
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
capabilities['chromeOptions'] = {'prefs' => preferences}
Capybara::Selenium::Driver.new(app, browser: :chrome,
desired_capabilities: capabilities)
end



The workflow will be like this:



Also probably you will be interested in capybara-sessionkeeper





This didn't fix the problem for me. What I did exactly: I put the code snippet that registers the driver before my test (but giving it a different name) and set the current Capybara driver to this. Then I ran the test that registers a user in my application. Chromium doesn't show a popup to save the pasword (and doesn't save it itself).
– Manuel Jacob
Jun 30 at 10:02






Could you please post the code you have tried?
– Andrei Suvorkov
Jun 30 at 10:08





paste.pound-python.org/show/sFPTwrD8siBWtvaGBr2W
– Manuel Jacob
Jun 30 at 10:32






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Y GPRQPnfm8wbghY Nrx6EJGN g8
t2KC4d Nib,4xQLloH4NCbIb55

Popular posts from this blog

Delphi Android file open failure with API 26

.

Amasya