If Function for login webpage

Ive already tried looking through forums but I couldnt find anything to get the Element Exist and If Function to work.

Currently when I go to the webpage it will sometimes ask me to login again, and sometimes it lets me do my tasks without login.

I am trying to create a “element exists” and if function where if it skips login then it clicks a check box and hit submit. If it asks me to login then it logs in and i proceed with the checkbox and submit

My work flow look like this:

Go to web page - Element exists (login page) - Then login and click check box and submit - Else Click checkbox and submit

It does the Else part perfectly when the login page does not appear. If the login page comes up i get an error highlighting click checkbox part in the Else part. Seems like it doesnt do anything in the then function.

My variable is set:

Name: elementfound
Variable type: boolean
Scope: Do
Default: nothing

if condition: elementfound=true

im very new to RPA and uipath so any extra detailed information would be great.

Thank you!


Use Element Exist, and find the unique element of the page like login button / some element which will not identify in the page where it is already logged in

No in IF condition write as

Then->True->Enter the login details
Else->False->place your click checkbox logic

Always validate the element in both scenarios, like login page, after login page

Hope this will help you


Hey @pdm ,

I think you have already reached out for what you want.

You just need to take the reliable selector for the element exist activity. Please refer below links.

Let me know, if you still faces an issue!


Ya my first question was regarding finding something on page but before I could even get to that I havent been able to get to the login part working.

Ive tried selecting many different things on the element exists but nothing seems to work.

Hey @pdm

Can you please upload the screenshot of the selector for Element exist?

it will help us!

Here is image. Ive tried selecting the whole webpage using default and AA. Also just tried the email box or password box

You dont need to select whole webpage. @pdm

Drag the Element exist activity and then click on indicate screen.


And then adjust your selector, like below.


Please refer below video as well, it will clear your concept.

Hi @pdm ,

Yeah try the suggestion from @shreyash_shirbhate . don’t select the entire screen for element exist activity just indicate the Submit button since it is unique Ui element in the login page. if you get submit button it means that you are on login page. please perform the login and after that proceed with subsequent steps. thanks.


My new selection.

Still doesnt seem to work. Maybe its just the webpage?

Oh I did try the submit button wasnt working either


Could you share the selectors for submit button pls.

yeah it looks super perfect. i don’t know why it is not able to recognize. do you see any errors for element exist or it is directly going to the else part.

Check do you have any default values for the boolean variable you are trying to get the output from the element exist.

1 Like

No errors on element exist and its going directly to else part.

No default value set it is left blank. Just that default “Enter a VB expression”

Edit: if i set default value to true the login does work. However, the else part doesnt work

ok Seems to be correct. Could you share the condition you are using in if. thanks

condition is booleanoutput = True

ok till now don’t see any issues. not sure what is the issue my friend. sorry not able to help you much on this. i hope you would get some help from other forum members. thanks.

Hey @pdm ,

Can you share the workflow with us if you don’t mind.


Hey @pdm ,

It looks super good, it should work, what’s the issue is giving now?