Issue
I need to handle authentication pop up in chrome browser with Robot Framework by pressing enter key or esc keys or click the cancel button. Like this
I'm trying using the SeleniumLibrary Press keys,
Press Keys None ESC
But it doesn't work
Does someone know how to resolve this? Thank you
Solution
Regretfully there's nothing you can do through Selenium here. This window is from the so-called basic authentication, where the user is expected to enter a username and a password and is handled at http level.
The control you see - the dialog box - is an OS component, part of the browser executables itself; as such, Selenium cannot interact with it - it is sandboxed from it (on purpose, for security).
There are couple of workarounds; credentials for basic authentication can be passed through the url - if the target system does not prohibit that explicitly. That's done through a special format of the url:
http://username:[email protected]/
Another one is to use a library for desktop automation - AutoIt, or Java's Robot. But this has 2 (huge for me) drawbacks - the solution is going to be OS dependant (e.g. one for Windows, and different for Mac, Linux), and mainly - you cannot employ it in remote selenium session - you have to have that desktop automation running in the remote machine, with a desktop session it intercepts, and accessible from your execution machine.
Answered By - Todor Minakov
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.