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.

enter image description here

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.

1

There are 1 best solutions below

0
On

To identify the li element, you can use //li[contains(.,'DOWNLOAD FILE')]

.(dot) can compare the text of any children or descendant elements of li, whereas text() can only compare the text of li element.

If you want help to identify the exact element, you will have to provide the DOM of li children as well.