TagUI icon indicating copy to clipboard operation
TagUI copied to clipboard

if the xpath contains '. It won't work - try this

Open evanpeng-life opened this issue 2 years ago • 2 comments

like this, echo false

https://www.google.com/search?q=what%27s+my+ip&source=hp&ei=2EJ8Y77PO7_nkPIP65GtoAM&iflsig=AJiK0e8AAAAAY3xQ6V8iK21hiMwkRgIN4Vs4Ug8vSdfS&ved=0ahUKEwi-m42Y7cD7AhW_M0QIHetICzQQ4dUDCAo&uact=5&oq=what%27s+my+ip&gs_lcp=Cgdnd3Mtd2l6EAMyBAgAEEMyBAgAEEMyBQgAEIAEMgcIABCABBAKMgUIABCABDIFCAAQgAQyBQgAEIAEMgUIABCABDIGCAAQChBDMgcIABCABBAKOhQIABDqAhC0AhCKAxC3AxDUAxDlAjoRCAAQ6gIQtAIQigMQtwMQ5QI6CwguEIAEEMcBENEDOgUILhCABDoKCC4QgAQQ1AIQCjoHCAAQgAQQDFDQG1ifXWD2ZWgBcAB4AIABkwWIAdgfkgELMC4xLjQuNC4yLjGYAQCgAQGwAQY&sclient=gws-wiz
wait 10
is_present = present('//div[contains(text(), "What\'s my IP")]')
echo `is_present`

evanpeng-life avatar Nov 22 '22 03:11 evanpeng-life

https://www.google.com/search?q=what%27s+my+ip+address+org
wait
is_present = present('//*[contains(text(), "My IP Address? Networking")]')
echo `is_present`

marcelocecin avatar Nov 22 '22 11:11 marcelocecin

Hi @EvanYiLi the issue is most likely due to the quotes in your string. I'd suggest you use another way to identify the element, but if you really need to identify by text, you can try to search for the other parts of the string without the quotes. For e.g:

present('//div[contains(text(), "What") and contains(text(), "s my IP")]')

ruthtxh avatar Nov 22 '22 13:11 ruthtxh

Closing but please ping back if this is still relevant of an issue.

kensoh avatar Aug 19 '24 12:08 kensoh