Access element that has text - Selenium

Q.  If you wanted to access the element that has the text "This element has an ID that changes every time the page is loaded" in it, then which of the following is used?
- Published on 13 Aug 15

a. //div[contains(@id,'time_')]
b. //div[contains(@id_time())]
c. //div[parameter(@id_time())]
d. //div[parameter(@id,’time_’)]

ANSWER: //div[contains(@id,'time_')]

Post your comment / Share knowledge


Enter the code shown above:
 
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)