validate error is displayed

Hi all,

Im just getting started with selenium webdriver

My test is to verify error message is being displayed when entering incorrect login details

How can i verify that error message has been displayed when entering incorrect
credentials, and capture what error message has been displayed on the page within the console in eclipse ide?

I have used the following in my selenium webdriver code:


I have tried xpath but getting the same outcome.

When running the selenium test, the gettext is not displaying the error text in the console but nothing is displaying..

sun Default Asked on June 14, 2016 in Selenium WebDriver.
Add Comment
1 Answer(s)

Hi Sun,

Did you try by using driver.findElement(By.XPath(“”)).getText();

Is the error message being displayed in Frame or Table?

Try the below code:

SD Train Answered on June 14, 2016.
Add Comment

Your Answer

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