• +91 9723535972
  • info@interviewmaterial.com

DevOps Interview Questions and Answers

Question - How can you access the text of a web element?

Answer -

Get command is used to retrieve the text of a specified web element. The command does not return any parameter but returns a string value.

Used for:

  • Verification of messages
  • Labels
  • Errors displayed on the web page
Syntax: 

String Text=driver.findElement(By.id(“text”)).getText();

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners