How to handle "save password" prompt on Android WebDriver app?

377 views
Skip to first unread message

Lukus

unread,
Dec 28, 2011, 8:29:50 PM12/28/11
to Selenium Developers
I don't understand why Selenium's WebDriver for Android prompts to
remember passwords after submitting a form. In other browsers I
understand there are preferences the user can set, but WebDriver is
only for browser automation testing and is created by selenium for
that purpose right?

After getting around the issue with sendKeys() on Android emulator
platform 2.2, and using javascript to put text in the fields and
submit, now I find that it prompts me to save the user/pass. I'd love
to turn this off but searching the net does not show that there is a
setting for this on the OS nor in WebDriver.

Has anyone else run into this issue, or have a suggestion on how to
handle it?

Lukus

unread,
Dec 29, 2011, 8:02:37 PM12/29/11
to Selenium Developers
I would suggest to the selenium team to have an option for turning
this off through DesiredCapabilities or some other method.

Currently, f you are using selenium for automation on android and have
a test that checks for logins on a page, then surely you have noticed
this. Disabling saved passwords for the actual Android Browser does
not affect the WebDriver. I suppose in the case where you are only
testing a website or two you can just click "remember" or "never" and
it won't appear again. For those of us that can't control the site
and are running this programmatically, I found a dirty work-around:

The Back key on Android acts like an Esc key on a desktop and just
ignores this pop up, allowing the script to continue. To do this in
an automated way, you can use:

adb shell input keycode KEYCODE_BACK

Actually that keycode is "4", and had to use the actual number to get
it to work. Ugly, but works until find a way to turn this prompting
off.

Dounia Berrada

unread,
Jan 6, 2012, 2:27:31 PM1/6/12
to selenium-...@googlegroups.com
Why not use the Alert API to dismiss it?

driver.swicthTo().alert().dismiss();


--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To post to this group, send email to selenium-...@googlegroups.com.
To unsubscribe from this group, send email to selenium-develo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-developers?hl=en.




--
Dounia

Lukus

unread,
Mar 28, 2012, 1:09:28 PM3/28/12
to selenium-...@googlegroups.com
The  driver.swicthTo().alert().dismiss();  did not work.  My guess is that it is since this prompt is not an alert, but a browser based dialog.  Any other suggestions for bypassing the prompt or possibly detecting it's presence?

Santiago Hernández Lemes

unread,
Sep 10, 2012, 1:17:55 PM9/10/12
to selenium-...@googlegroups.com
Did you try creating a profile for yourself?
If the password is stored on that profile then selenium will not prompt you anymore.

On Mon, Sep 10, 2012 at 7:01 AM, Deepak Goel <deepak...@gmail.com> wrote:
Dear Lukus

I am also facing the same problem. I tried your solution but the problem is still remain same. Please elaborate your solution.

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.

To post to this group, send email to selenium-...@googlegroups.com.
To unsubscribe from this group, send email to selenium-develo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-developers?hl=en.



--
 Santius

Lukus

unread,
Sep 11, 2012, 11:13:20 AM9/11/12
to selenium-...@googlegroups.com
The problem was corrected in newer versions of Android apk, so you only have to use the "back" key on older implementations. Which apk and which Android OS are you using?  You should not have this problem on Android 4+ using the latest apk.

  
Reply all
Reply to author
Forward
0 new messages