in Testing by
Q:
Briefly explain what does below code snippet indicate?

1 Answer

0 votes
by
WebElement sample = driver.findElement(By.xpath("//*[contains(text(), 'data')]"));

It defines a variable sample of type WebElement, and uses an XPath search to initialize it with a reference to an element that contains the text value “data”.

This brings us to the end of this article on Top 50 Software Testing Interview Questions. Hope it helped in adding up to your knowledge. Wishing you all the best for your interview. Happy learning.

If you found this “Software Testing Interview Questions” article relevant, check out the Software Testing Training by Edureka, a trusted online learning company with a network of more than 250,000 satisfied learners spread across the globe.

Related questions

0 votes
asked Oct 7, 2019 in Bootstrap by Tracy Williams
0 votes
asked Mar 21 in JavaScript by rajeshsharma
...