How can I confirm the text "FIND ME PLEASE" is displayed on a webpage using Java? Please refer to the HTML code below:
<table width="600" border="0" cellspacing="5" cellpadding="0"> <tr><td class="fontlargebold" align="center"> FIND ME PLEASE </td></tr> </table> The difficulty resides with the HTML code not having attributes such as ID, name, value...etc. I attempted to use xpath (By.xpath("//*[text()=[contains('FIND ME PLEASE')]]")) )but I don't think it's correct...
contains-function correctly.containsneeds two arguments, first the content to be searched and second the searchstring. See the W3C Specifications for contains() for some examples.