Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
154 views
in Selenium by
retagged by
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 -->
text1.contains("0");

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

Can anyone help me out with this.

1 Answer

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


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...