I just started automation using Robot Framework with Selenium Library. I was able to run a sample test in our application. The issue I am seeing is the authentication popup.
Could some one please help me how to handle this authentication popup using Selenium Library? Also this popup does not come all the times. How to check if that pop up is there or not?
Thankyou for your reply. Below is the popup that I am seeing (for security reasons I whitened out the URL) and this is not a browser popup (I think this is a native popup because I am not able to inspect it). I want to try by passing Username and password in the URL but this only comes sometimes and not sure when. Could you please help me how to handle this with Selenium Library in Robot Framework?
Actually because you can’t inspect it, it probably is browser popup, because if you could inspect it it would be a html popup.
What you didn’t mention before was that it’s no the AUT that is requesting authentication but rather the proxy server.
One thing that concerns me is your comment :
What I suggest you do is set up a simple robot file with a single test similar to the one below (guessing that you are using Chrome):
*** Settings ***
Library SeleniumLibrary
*** Keywords ***
Open Admin Page
Open Browser about:blank Chrome
Go To https://your.application.page
Wait Until Page Contains <Some text you expect on the first page>
The first thing you want to confirm is if this test always fails with the proxy dialog you showed or only sometimes?
If this dialog only appears sometimes, that would indicate that you have multiple proxy servers in your environment and they are not configured consistently, so this should be raised with your IT support team to ensure all the proxy servers are correctly configured, once this has happened you should be getting either
always now getting this dialog or
never getting this dialog
Once you are at a point where you are getting a consistent behaviour, if you still need to authenticate with the proxy try changing the test case to:
*** Settings ***
Library SeleniumLibrary
*** Keywords ***
Open Admin Page
Open Browser about:blank Chrome
Go To https://<proxy username>:<proxy password>@your.application.page
Wait Until Page Contains <Some text you expect on the first page>
Also note if the proxy user name needs the windows domain name in the format of <domain>\<username> don’t forget to escape the \, i.e.<domain>\\<username>
Thankyou Dave, apologize for the delay. I will try out all the options above. I tried Browser library as well and noticed that could be handled in Browser Library.
If this is HTTP Authentication, as seen in this web testing demo site or as shown in the link Dave has shared above then the underlying Selenium 4 has added functionality to handle this. The SeleniumLibrary (the Robot Framework library connecting Robot Framework to Selenium) can add this. The SeleniumLibrary core team has a survey out asking which of the new Selenum 4 features due users want to see prioritized including authentication.