Join 500+ Software Testing professionals. Solve problem and get your problem solved. Register Now!

Need help with text assertion in Selenium WebDriver

Solved 1 Answers 46 Views Selenium
0 1
I have to assert a text from the browser, the text I am trying to check is "0"

[i.e.<div name="text1">0</div> ].

I am using
to get the text -->
 "string text = driver.findElement(text1).getText;"
to check -->

the issue I am facing is getText() is returning empty string(i.e. null string).

Can anyone help me out with this.

1 Answer

Best answer
Looks like the way you are identifying element is wrong. Kindly let us know the way you are identifying an element.
answered by
selected by

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.