How to Using Find Element with If Statement?

Hi. I want to use Find Element in Anchor Base like that.

if find Username write my username but if don’t find, don’t write anything

How can I do that ?

You can use continue on error for those activity
Or for better use you can keep them into Try and Catch block
In catch just use write line/ Log message for keeping Log.

1 Like

Hi
Then we can use ELEMENT EXISTS activity before ANCHOR BASE
That is the Sequence be like this
—use a ELEMENT EXISTS activity and select that element and get the output with a variable of type Boolean named bool_exists
—and now use a IF activity like this
bool_exists = True

If true it will go to THEN part or goes to ELSE part
Where in THEN part we can place the ANCHOR BASE activity and else part can mention as
bool_exists = False using assign activity

Cheers @sufyant

1 Like

Is it the true ?. Not working

1 Like

If the element is inside any web page then place this whole sequence of activities inside a ATTACH BROWSER activity
Or if it’s inside any new window then place this whole sequence inside a ATTACH WINDOW activity and try once

You were almost done
Also make sure that in Else block mention as
False and not as “” as value
Cheers @sufyant

1 Like

Do I take the whole process into “ATTACH WINDOW”?

1 Like

I mean like the activity from where we search for this element or look for this element
Cheers @sufyant

1 Like

Still not working

1 Like

Fine
May I know what was the error we were facing
Cheers @sufyant

1 Like

I am so so sorry buddy in fact, the system is working but slow. so it a little longer.I thought didn’t working :grin:

1 Like

No worries
Cheers @sufyant

1 Like

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