Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Need to display the alert box and click OK while running the script. I have used javascript alerts.

Eg:

function validateMob(val) {
   var temp = val.trim();

   if (temp == null || temp == "") {
     alert("Enter Mobile Number");
     return false;
   } else if (temp.length != 10) {
     alert("Enter Valid Mobile Number");
     return false;
   } 
   else {
     return true;
   } 
}

Also have used to verify the text in the alert box

Alert alert = driver.switchTo().alert();
String text=alert.getText();
alert.accept();

Need to display the alert box and click OK. Is it not possible to view the alert box using selenium web driver ?

share|improve this question
    
What is the problem? To "view" something in selenium is not very specific... –  luksch Jun 11 at 11:06
    
What you want to achive? Can you be specific? Is this related to selenium IDE? –  Purus Jun 11 at 13:27

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.