java - Selenium div attributes keep changing, how can I find this element? -
i trying find element selenium , java, problem element's id, class, , name increment not able find selenium. below trying:
webelement field = driver.findelement(by.xpath("//input[contains(@linktext, 'broadcast copy')]"));
in html file these attributes keeps changing:
id="files[%2fopt%240%2frules%2f%2f000102%2.xml][%2fcluster%2fname]" name="files[%2fopt%240%2frules%2f%2f000102%2.xml][%2fcluster%2fname]" value="copy (cluster 102)"
entire html
<tbody> <tr class='rowodd'> <td><b>name</b></td> <td> <input type='text' data-validation='required validate-name-unique validate-name-not-empty' size='65' id='files[%2fopt%240%2frules%2f%2f000102%2fcluster.xml][%2fcluster%2fname]' name='files[%2fopt%240%2frules%2f%2f000102%2fcluster.xml][%2fcluster%2fname]' value='copy (cluster 102)' /> </td>
these increment , have no access html file change anything. question how can find input element? in advance.
update
i error:
unable locate element:{"method":"id", "selector":"files[.*][.*]"}
i believe xpath using incorrect. use
//input[contains(text(), 'broadcast copy')]
instead of
//input[contains(@linktext, 'broadcast copy')]
according html have provide following should work well
//body[contains(.,'name')]//input
Comments
Post a Comment