1

Sign In snapshot

Here is the detail and options I have tried.

  1. As soon as URL is launched, a authenticate pop gets displayed at the top center of screen.

  2. The popup does not have any webElements.(No Inspect option or F12 does not show up any elements)

  3. I tried using Alert, getWindowHandle(s) nothing seems to be working.

  4. I tried traditional way driver.get("http://UserName:Password@Example.com"); Even this does not work as my URL is secured URL, does.

Is there any way I can handle this using Java code in Selenium

// Attempt 1:
String logScrn= driver.getWindowHandle();   
System.out.println(logScrn);
driver.findElement(By.id(logScrn)).sendKeys("username" + Keys.TAB + password");  

// Attempt 2:            
Alert alert = driver.switchTo().alert();
alert.sendKeys("username" + Keys.TAB + "password" + Keys.TAB);
alert.accept();
Greg Burghardt
  • 17,900
  • 9
  • 49
  • 92
Daniel S
  • 13
  • 5

0 Answers0