GetText returns null | Selenium Forum
V
Valerie Kollmann Posted on 05/04/2019

Hello,

I am using Selenium Webdriver with Java and the Chrome browser. I am trying to get the text for Product Description. I have tried getText() and getAttribute and both are returning null. The screenshot shows the text I am trying to get, along with the HTML code. Can someone please tell me why this doesn't work?

 

Thank you.

 


A
Ashish Thakur Replied on 09/04/2019

make sure that the locator you're using is correct. It may be the reason


V
Valerie Kollmann Replied on 09/04/2019

I've tried all the locators below and getText did not work. Even when using the absolute xpath, getText did not work. The cursor moves to the correct location so the locator is correct. Do you know why getText is not able to extract the text?

 


A
Ashish Thakur Replied on 10/04/2019

Please share the project so that we can analyze the issue.