TagUI icon indicating copy to clipboard operation
TagUI copied to clipboard

if exist(..) is not executing as intended.

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

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!

evanpeng-life avatar Oct 04 '22 10:10 evanpeng-life

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

ruthtxh avatar Oct 06 '22 08:10 ruthtxh

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

evanpeng-life avatar Oct 06 '22 09:10 evanpeng-life

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

kensoh avatar Aug 19 '24 12:08 kensoh