How to handle alerts in selenium webdriver?



How to handle alerts in selenium webdriver?..

Answer / Priya Raghuvanshi

In Selenium WebDriver, you can handle alerts using the Alert interface. Here's an example using Java:nn```javanalert = driver.switchTo().alert();nalert.accept(); // or alert.dismiss() to dismiss the alert without accepting anythingn``

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Selenium Interview Questions

What is a node in selenium grid?

1 Answers  


What are various ways of locating an element in selenium?

1 Answers  


What / supported operating system platforms Selenium?

1 Answers  


Tell me what are the advantages of using git hub for selenium?

1 Answers  


What are the programming languages supported by selenium webdiver?

1 Answers  


When should one use selenium grid?

1 Answers  


How can we create object repository in selenium?

1 Answers  


What’s selenese?

0 Answers  


How testing is better than junit?

1 Answers  


What evaluation can selenium do?

1 Answers  


What types of tests are compatible with Selenium?

1 Answers  


What test can selenium do?

1 Answers  


Categories