IF function but on a web page?

I need to BOT to run a series of events within IE to pull multiple reports for my company. When you open IE, sometimes our system already logs us in and sometimes we need to login with our username and password. The BOT is built to log the user in, so we ask users to manually clear their IE cache in order for the BOT to run smoothly.

However, there has to be a way to tell UIPath if when you open IE and it looks like this (grab image), then perform these actions. If it doesn’t look like this, then perform these actions. I tried an IF statement, but couldn’t understand how to configure. Any help is greatly appreciated! Thanks.

Hi @nataliagrujic

Welcome to the community!!

You are exactly thinking in the right direction. We can have that kind of configuration.

So, If the page loads the login screen, you can look for a word “Login” right? To check for it, you can use Element Exists activity to find the login word or something unique in the login page.
To check whether you are already loggedin and it is showing the dashboard/ home screen, you can have another Element Exists activity to check for something unique (something that is not in login screen) in the home page.

So, based on the results you get for your two Element Exists activities, you can decide what to do using a IF activity :slight_smile:

Get the idea?

1 Like

Hi there @nataliagrujic,
Firstly, welcome to the UiPath forums!

Regarding your query, you can certainly achieve this.
You can use an ‘Element Exists’ Activity to check for the login screen after launching IE at your desired URL.

Should the login page exist, then execute your login functionality, otherwise, skip past it.

It would look similar to the below:
Element Exists - Login Page - Output = boolLoginRequired
If boolLoginRequired = True Then
* Login Functionality (Type Into Username, Type Secure Password, Click Login, etc.)
* Log Message - No Login Required (Optional)
End If
Rest of your code!

Please let me know if you have any queries regarding this.
Thanks in advance,

Thank you! Yes - this worked within the IF activity. Appreciate your help!


Glad to hear it worked for you…

Let us know if you have any further questions on this too. Would be glad to help…

If we helped you to sort it out, please also mark the best supported answer from the above as the solution too :slight_smile: It could help others.

1 Like