Categories

Dec 9, 2019 in Testing

Q: Briefly explain what does below code snippet indicate?

1 Answer

Dec 9, 2019
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.
Click here to read more about Loan/Mortgage
Click here to read more about Insurance

Related questions

Madanswer
Jan 21 in ECMAScript
May 30 in Node.Js
Jan 30 in Selenium
...