I am trying to find the Xpath for the below image. The one on the right is the Download File link and the right is element DOM.
I have tried with directly copying the Xpath and also used the Contains text "Download File" but my script is not working and giving No Such Element exception.
Could you please let me know the possible Xpath for these.
Thanks !
Tried to find Xpath's using contains and as list, but did not work.
To identify the
li
element, you can use//li[contains(.,'DOWNLOAD FILE')]
.
(dot) can compare the text of any children or descendant elements ofli
, whereastext()
can only compare the text ofli
element.If you want help to identify the exact element, you will have to provide the DOM of
li
children as well.