TagUI
TagUI copied to clipboard
if the xpath contains '. It won't work - try this
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`
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`
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")]')
Closing but please ping back if this is still relevant of an issue.