Wednesday, 8 February 2017

Selenium - How to handle login popups in Chrome browser

I was facing issues while dealing with one of the applications where the login popup is coming to fill the user id and password which is not the web elements to be handled using the selenium webdriver.

I have come across a solution which is very simple to be used in chrome. We just need to append the userid and password with the url of the application and load it into the browser.

 String[] URLText = URL.split("//");
 String URL2 = "//" + UserID + ":" + Password + "@" + URLText[1];
 URL = URLText[0] + URL2;
 driver.get(URL);

I hope it will resolve the issues if any one faces same.

I will share the same for Internet explorer in my next post.

No comments:

Post a Comment