Automate Incognito…But Why?

We’ve all used Chrome’s incognito mode for reasons I am not about to go into.

Quit acting like you don’t know what I’m talking about.

So why do we do it?

Let me rephrase that, why do we use incognito?

What’s so special about it?

Adding to What We Already Know

It hides your activity online…well sort of, but yeah. Incognito doesn’t store the history, cookies and cache – and the last two are important in our discussion.

The browser was designed to behave this way so as to improve user experience. Storing cache helps with loading webpages faster, while storing cookies ensures that the browser remembers that you logged into XYZ application.

Here’s an example just to give you an idea of what goes on in the backroom as we interact with applications online.

When you log into your Salesforce account, the login and site details are kneaded into cookie dough, cut into several shapes, and placed into the oven for as long as the session is active.

What this also means is if you close the browser without logging out, your session will still be active.

In other words, the oven is lit and cookies are still being baked.

This becomes a problem, because bots aren’t intelligent enough to understand that the session is still active and that it doesn’t have to log in again.

Sure, you could get fancy with it and program the bot to check if an element which is only present on the homepage is visible before logging out and logging back in with the right account, but there is a much better way of approaching this.

Wait a Minute, Why Log Out When Its Already Logged In?

Not all accounts have access to resources which the bot has to interact with, which is why we create service accounts with specific privileges for bots.

If the bot simply checks if the Salesforce page is open without verifying whether it has logged in with the right account, you could potentially run into several access issues.

This is why it’s always best to check if closing the browser automatically terminates the session before deciding whether to automate on chrome or incognito.

As for logging in and logging out, that is the lazy way of overcoming this.

I’m not going to lie, I used to follow this approach because I didn’t know Automation Anywhere could work with Incognito. Anytime I captured objects in Incognito, the Capture Action recorded the entire window and wouldn’t let me interact with the elements within it.

You see how random my searches are? This is why I browse incognito – its to protect the FBI agent’s sanity.

It’s only later on that I realized why.

Ever Heard of the “Automation 360 Extension”?

I bet you have.

Automation Anywhere can’t simply interact with Chrome. An extension has to be installed and activated for the bot to take control of it.

While installing the Chrome Extension, it automatically activates itself for normal browsing but remains inactive in Incognito.

To make it work in Incognito, you have to navigate to Manage Extensions > Automation 360 Details and toggle Allow in Incognito.

Now nothing can stop us from automating incognito!

Nothing Except…

How do we get to Incognito in the first place?

There must be an action for that right?

Lets take a look at the Browser: Open Action.

Oh whaddya know, it looks like we already have an incognito tab that we can take advantage of.

I don’t know about you but that “Incognito” tab looks kinda sus…

Awesome Powerpoint skills aside, there aren’t any options in the Browser Action that will let us access Incognito, however there is a way to run Chrome in incognito.

Is it redundant to say “Run Chrome in incognito”?

Mai Engrish not bery gud

If you’ve worked with V11, then you know where I’m going with this.

Open the Program “Directly”

Apart from Browser Actions, Automation Anywhere also lets us open applications, as long as we know where it’s located.

But before I show you how that works, locate your Chrome Application > Right click > Properties and copy down the Application path.

It should look something like this:

C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

Next, open Command Prompt from the windows menu. If you prefer using shortcuts then press Windows Key + R and type in cmd.

Now paste the Application Path followed by a –incognito.

This will open Google Chrome in incog..inni…incognito.

I give up.

Over to the RPA Workspace

Under Actions, search for Application and double click on the Open Program/File Action. This also brings it onto the RPA Workspace (for those of you who are used to dragging actions).

There are two Fields which are important, namely the Location and Parameters.

The Application Path goes into Location, while the –incognito goes into the Parameters.

Also, it isn’t necessary to pass in the entire Application Path. Just the Process Name will suffice.

And There You Have It!

Actually, there’s a bit more to explore before we can conclude.

Launching Chrome will only launch the application. What if I wanted to navigate to a certain website?

Sure, you could use a combination of keystrokes to get that done:

F6 + Ctrl+A+Del+$sURL$ in case you were wondering.

But that ainnit.

We don’t have to keystroke our way to the website and risk suffering a stroke in the process. All you have to do is pass the URL in as a Parameter and you are good to go.

In Conclusion

I’ve decided to conclude on an interesting tip.

If you want Google Chrome to always launch incognito, then simply head back over to Properties and pass “-incognito” into the Target field and you are all set to go incognito.

And with that, you have a clean slate to work with!

That’s about it, see you next week.






What, you’re still here?

Oh, you are still hungry for more eh?

Well you’re in luck, as I’ve dedicated an entire section to Web Automation, which you can find here .

Leave a Comment