Explain what does following statement does:

788    Asked by KaylaShinn in QA Testing , Asked on Dec 7, 2019
Answered by Kayla Shinn

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

Above statement defines a variable text of type WebElement and applies the XPath search to initialize it with a reference to an element that contains the text value “sample”.



Your Answer

Interviews

Parent Categories