• +91 9723535972
  • info@interviewmaterial.com

Selenium Interview Questions and Answers

Question - Explain how to assert text of webpage using selenium 2.0 ?

Answer -

WebElement el = driver.findElement(By.id(“ElementID”))

//get test from element and stored in text variable

String text = el.getText();

//assert text from expected

Assert.assertEquals(“Element Text”, text);

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners