How can we get a text on a web element using Selenium WebDriver?
Watch the answer for this Selenium Interview Question in a detailed manner in the below youtube video:
Note: Don’t forget to subscribe to my Youtube channel.
Notes used for explanation in this Youtube video are provided after the video:
Notes used in the above Youtube Video:
Based on how the web element is storing its displayed text in HTML, there are two ways to get the text that is displayed on the web elements:
- > First way using getText() WebDriver command
- > Second way using getAttribute() WebDriver command
- > For more Selenium Interview Questions and answers, continue to the next post (Click on Next Post link below)
- > Check complete Selenium Interview Questions list here (Click here)
Please leave your questions/comments/feedback below.
Happy Learning ?