Webpage i am automating: https://app.ghostinspector.com/account/create
Scenario: I am clicking on the signup page and entering details and clicking on the register button, now if user passes a same email address the message "E-mail address is already in use." is displayed on the website so what i am trying to do is that locate the text message clear it and enter another email address at runtime.
Now the problem is that the error message text is not fetched by the gettext method of selenium.
Below is the code:
WebElement email_in_use = driver.findElement(
By.xpath("/html/body/div[1]/div/div/div[2]/form/div/div[1]"));
String message = email_in_use.getText();
System.out.println(message);
Let me know whats the problem here.