top of page
Search

Functions getText() from WebElement always return ""

Updated: Dec 27, 2022

Problems:


Sometimes when you try to get the text of WebElement from built-in function getText(), you accidentally get the result as a blank string "". If you have already checked the locator path is correct, the code is right but the text gets from elements was still blank, you may get into this issue: The expected text you want to get is out of the current screen view.


Solutions:

  • Scroll your view into the selected web elements. Example for scrollIntoView() functions written in Java

  • Use getText() to get displayed text.

35 views0 comments

Comments


bottom of page