TagUI
TagUI copied to clipboard
if exist(..) is not executing as intended.
code: `https://www.lowes.com timeout 15
logged = exist('//*[@id="account-name" and not(contains(text(), "Sign In"))]')
echo logged
if exist('//*[@id="account-name" and not(contains(text(), "Sign In"))]') echo Signin else echo Signout
if logged echo Signin else echo Signout`
printed log: https://www.lowes.com - Lowe’s Home Improvement
true Signout Signin
https://www.lowes.com/ - Lowe’s Home Improvement FINISH - automation finished - 21.4s
Please tell me where I am wrong, thanks!
Hi @EvanYiLi you can try the following
https://www.lowes.com/
read //*[@id="account-name"]/text() to status
if (status!="Sign In")
echo Signin
else
echo Signout
Thank you for your answer. Why are the results of these two pieces of code different?
logged = exist('//*[@id="account-name" and not(contains(text(), "Sign In"))]') //is true
if exist('//*[@id="account-name" and not(contains(text(), "Sign In"))]') // is false
Closing but please ping back if this is still relevant or an issue.