For example the modal dialog pop-up after clicking "Logout" link, so the code like this:
driver.findElement(By.linkText("Logout")).click();
driver.switchTo().activeElement().sendKeys(Keys.ENTER);
driver.switchTo().alert().accept();
"Mouse" hover to your WebElement as a bonus in case you are looking for:
//simulate the mouse hover
Actions builder = new Actions(ldriver);
Action action = builder.moveToElement(sportslink).build();
action.perform();
Hope it helps!
No comments:
Post a Comment