开发者

Watir hangs after Chrome asks "Do you want google to save your password"

开发者 https://www.devze.com 2023-02-12 08:18 出处:网络
I\'m having Watir login and do some stuff on the next page. This works fine on Firefox, but chrome loads the :

I'm having Watir login and do some stuff on the next page. This works fine on Firefox, but chrome loads the :

"Do you want google to save your password" dialog

which makes Watir hang. Running the script from irb, I'm noticing that at that point I'm losing access to the browser object.

Clicking "Never for this site" or "Save Password" doesn't seem to work开发者_运维百科 either since it seems that every time that webdriver loads chrome, it loads in on a new session.

Any ideas?


If you go to Configuration -> Options -> Personal Stuff there's a check box for "Never offer to save passwords" that may change the setting for the program, rather than just the instance you're currently interacting with.


I had a similar problem (everything works in Firefox but not Chrome) and maybe this will help. Do you have any regular expressions in your code after the page loads?

In my code I modified this statement: @browser.text_field(:id => /txtfield/).wait_until_present

to this: @browser.text_field(:id => 'longform_txtfield').wait_until_present

That is to say that I removed the /txtfield/ regular expression and replaced it with the full id name of 'longform_txtfield'. Obviously you and I have very different code but try experimenting with commenting out certain lines after the page load to see what may be responsible. It just might turn out not to be the Password Manager after all!

Cheers!


I know this is may be an old question but I did stumble upon this question while looking for a solution using Watir-webdriver.

The below snippet will open a Chrome browser with the password manager disabled i.e. the "save your password" dialog will not pop-up;

profile = Selenium::WebDriver::Chrome::Profile.new
profile['profile.password_manager_enabled'] = false
@browser = Watir::Browser.new :chrome, profile: profile
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号