How do you handle Alerts and Pop Ups?

Answer Posted / chetan phani.j

Alert popup
Alert a =driver.switchto().alert()
String text=a.getText().
syso(text);

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the annotations available in testng?

492


What are the significant changes in upgrades in various selenium versions?

500


What is pom (page object model)? What are its advantages?

466


what is the use of x-path?

526


How to capture screenshot in selenium webdriver?

495






How to clear the text in the text box using selenium webdriver?

459


Explain what is the difference between find elements () and find element ()?

488


How to print Duplicate values in Drop Down List

509


What distinguishes between an absolute and relative url in side?

487


How to enforce the title of the website?

516


Mention in what ways you can customize testng report?

745


What is the difference between driver.get() and driver.navigate.to()

509


What are the different exceptions you got when working with webdriver?

458


How to scroll down a page using javascript in selenium?

473


How do you read test data from excels?

494