I am trying to click on a webelement that changes ID and xpath dynamically. I dont see any other information that can be used directly to identify the element uniquely everytime the page loads.
Here is the Xpath for the element:
This will be updated along with ID at every page load.
Here is the HTML code for the same element:
<table width="74px" height="30px" cellspacing="0" cellpadding="0"> <tbody> <tr> <td class="OBToolbarTextButtonFocusedOver" valign="center" nowrap="true" align="center" onfocus="isc_OBToolbarActionButton_3.$47()" tabindex="-1"> Pu <u>b</u> lish </td> </tr> </tbody> </table>
I want to click on the button with Text called "publish" with 'u' having an underline
Here is what i have tried to no success:
publish = //td[. = 'Pu<u>b</u>lish']
publish = //td[contains(text(), 'lish')]
publish = .//*[@id='isc_S7']/table/tbody/tr/td # this is just an example to show id, xpath and everything is dynamic.
Please assist. Thank you.