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.