I tried Using below code but not worked.
WebDriverWait wait = new WebDriverWait(driver, 2);
wait.until(ExpectedConditions.alertIsPresent());
Alert alert = driver.switchTo().alert();
alert.sendKeys("Uname" + Keys.TAB + "pwd");
alert.accept();
I tried Using below code but not worked.
WebDriverWait wait = new WebDriverWait(driver, 2);
wait.until(ExpectedConditions.alertIsPresent());
Alert alert = driver.switchTo().alert();
alert.sendKeys("Uname" + Keys.TAB + "pwd");
alert.accept();
Verify the popup present after the landing page loaded,if popup presents use getcurrenturl
method and concatenate the username and password with the current url.
Use the below code it may work
driver.get('https://example.com/')
driver.switchTo().alert().sendKeys("username" + Keys.TAB + "password");
driver.switchTo().alert().accept();