Challenge 01 (November 21): In the below snippet, select WebElement using the innerText property?

HTML Code: <span>Happy testing</span>

Options:

coding-challenage-q1

Select the preferred option and add it in the comments below.

Be a good Samaritan: Hit the ‘Share’ button to challenge your fellow QA geeks!

3 Likes

The right choice is "B : Xpath - “//span[contains(text(),‘Happy testing’)]” Also my alternatives for Xpath are 1. “//span[text()=‘Happy testing’]” 2. “//span[.=‘Happy testing’]” 3. “//span[contains(.,‘Happy testing’)]”

5 Likes

The right choice here would be B: XPath= //span[contains(text(),‘Happy testing’)], Alternatively, we could have used //span[text()=‘Happy testing’]

1 Like

B: XPath= //span[contains(text(),‘Happy testing’)], Alternatively, we could have used //span[contains(.,'Happy testing’)]

1 Like