0

I want to test a website in a private network. When I go to "http://www.crazysite.com" the proxy redirects me to "http://login.craxysite.com/?aLotOfParams=true". This site opens the "your connection is not private" popup.

enter image description here

I tried to skip the authorization with ChromeOptions without success.

Can I log in on it? How?

WebDriver driver = new ChromeDriver();
driver.get("http://www.crazysite.com");
System.out.println(driver.getPageSource());

getPageSource() Give me the page under the popup.

I use Chrome e ChromeDriver Version 88.0.4324.

  • Is the authentication popup shown also in a browser opened manually ? Have you checked this solution out ? https://stackoverflow.com/questions/45345882/selenium-basic-authentication-via-url – Piotr M. Feb 04 '21 at 12:04
  • One more option: driver.switchTo().alert(); //Selenium-WebDriver Java Code for entering Username & Password as below: driver.findElement(By.id("userID")).sendKeys("userName"); driver.findElement(By.id("password")).sendKeys("myPassword"); driver.switchTo().alert().accept(); driver.switchTo().defaultContent(); source: https://www.softwaretestingmaterial.com/handle-authentication-popup-window/ – Piotr M. Feb 04 '21 at 12:10
  • @PiotrM. switch to alert works only one alerts thrown from the webpage not from the browser, – PDHide Feb 04 '21 at 16:34
  • Thank you PiotrM e PDHide. I had tried a lot of things but the web driver doesn't work with the redirected popup. I found a non-solution: I used Robots to press ESC. Then I can log in to the page below. Robo tr = new Robot(); r.keyPress(KeyEvent.VK_ESCAPE); r.keyRelease(KeyEvent.VK_ESCAPE) – Spirit - Stop War in Ukraine Feb 05 '21 at 13:03

0 Answers0