Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How do you handle Alerts and Pop Ups?

Answer Posted / annasaheb

To Handle Alert

Alert alert = driver.switchTo().alert();
message = alert.getText();
alert.accept();//to accept alert
alert.dismiss();//to cancel alert

Is This Answer Correct ?    19 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different methods to refresh a web page in webdriver?

896


How to pass parameters using testng.xml?

894


How you are integrating cucumber feature files with step files?

877


What is the command to insert text into the HTML text box using Selenium?

968


How to run a group of test cases using testng?

1012


What is the alternate way to click on the login button?

993


What are the advantages of page object model framework?

914


How to run selenium webdriver test from the command line?

1091


Do you know how to mouse hover an element in selenium?

925


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

964


Do you know what are the main advantages of selenium grid?

943


What difference do you make between soft vs. Hard to say in selenium?

970


Which webdriver implementation claims to be the fastest?

1065


How to handle a dropdown in selenium webdriver?

3090


What is the difference between driver.findelement() and driver.findelements() commands?

879