• Home
  • Recent Q&A
  • Java
  • Cloud
  • JavaScript
  • Python
  • SQL
  • PHP
  • HTML
  • C++
  • Data Science
  • DBMS
  • Devops
  • Hadoop
  • Machine Learning
in Selenium by
Q:
Explain how to assert text of webpage using selenium 2.0 ?

1 Answer

0 votes
by
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);

Related questions

0 votes
asked Aug 19, 2019 in Selenium by rahulsharma
0 votes
asked Aug 19, 2019 in Selenium by rahulsharma
...