mercredi 16 novembre 2016

Detect text in the form with selenuim

Hi i am trying to write a java script using selinuim web driver to verify if a user already exist during the sign up . when a user acces to my website he click on "become a tinze" home page of my site

then he complete the form and clique on "join" sign up form

if the mail already exist messag "Email Already exist" displayed .Email Already exist

my script successfully complete the form but it can t detect the message "Email Already exist"

here is the html code of the message that i m trying to detect

<p name="already" style="color:Red;" class="ng-binding">Email Already exist</p>

and here is the code i use to verify if the text is displayed but it always show me detected

 try {
  driver.findElement(By.cssSelector("p[name=\"already\"]"));
   System.out.println("detected");
} catch (NoSuchElementException e) {

       System.out.println("not detected");

}

Aucun commentaire:

Enregistrer un commentaire