Hello, evryone need some help with element exsist

I am trying to login to an application. sometime the login section keeps open as shown
image
so, i have used element exist to get the value into a variable and used if condition to log out and log in. it works fine but, in the element, does not exist the process stop and throw an error.
so how to use element exist and make the bot continue to work even if the element does not exist

@mohamed.saty2012

In element exist

Give logOut=True

If that element exists perform action

Or
else

If the above one not works

Use check app state activity instead of element exists

ok, but is there a way to fix this

@mohamed.saty2012

In if give logOut=True

i have don as you suggested and i have got this error

Hi @mohamed.saty2012

Delete the Element exist activity, drag and drop the same activity and indicate again.

Do it same for Click activity which is inside Then block in If condition.

When you are indicating the element maximize the application window then indicate on it.

Hope it helps!!

It is loooong past time you should be working in modern, and therefore using Check App State.

if i used check app statues will it be the best practice for such cases

@mohamed.saty2012

Yes it is a best approach,Check app state is a modern activity

but i have noticed that it takes time if the element does not exist. is there a way to make it faster if the element does not exist

@mohamed.saty2012


Please Mention the time in that.It will wait upto that time if the element appear then it will do action,if not then it won’t do

Thanks for your support i am really appreciate it.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.