Alert popup

HI all

how to handle alert popup ok and close?

help me the solution

Default Asked on January 13, 2015 in Selenium WebDriver.
Add Comment
  • 1 Answer(s)

    hi  Sarbashree,

    code in webdriver

    Alert alt= driver.switchTo().alert();
    alt.accept(); // it is for ok  button

    or

    Alert alt= driver.switchTo().alert();
    alt.dismiss(); // it is for cancel  button

    Train Answered on January 14, 2015.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.