0 votes
in Jenkins by
How can you access the text of a web element?

1 Answer

0 votes
by

How can you access the text of a web element?

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();

Related questions

0 votes
asked Sep 19, 2023 in Angular by DavidAnderson
+1 vote
asked Jan 28, 2021 in HTML by SakshiSharma
...