Browser not opening in the foreground


I am trying to perform web automation where I need to click on an image after the page loads. When I click on the run(F5) button, sometimes the browser opens in foreground and the bot is able to recognize the image and click on it. But, many times, the browser opens but it is not in the foreground and the bot waits till the timeout and then throws an error. However, during the timeout period, if I click on the browser button in the task bar and maximize it, the bot is able to recognize the image and click on it. How do I always open the browser in the foreground?

Any help will be highly appreciated.



If you are able to access the selector information You can use the Activate Activity. Also there is a maximise window activity which may also have the same effect. Both should bring the window to the front regardless of what else is open.

If you cannot see the selector information then you will probably have to automate the steps you took manually - e.g. click the Internet Explorer icon on the task bar


Hi Richard,

I tried using different windows activities like maximize window, show window, etc. but no success.
Will try to use activate activity and update.


Tried using activate activity as well but, no success.

Activate activity does not work every time. It works sometimes. Sometimes, it does not.

1 Like

Why using click image within a browser?

Because I am unable to create a reliable selector.

you have to put minimize maximize both to bring it up .

In our case all the bots in production are getting impacted due to an Updgrade on the Environment( IE/JAva applet based windows). I wanted to know what is the root cause so that we can correct the root cause rather than upgrading production code of dozens of processes.

HI Team,
I am facing one issue in uipath, please find below the issue.
1.) Application not coming in foreground when running on VM in unattended mode
2.) tried all the way to make it in foreground using activate window activity and other , same code is running fine when we login to the system …
please help us .

It works for me when I use attach window activity with show window activity in it.


Did u get any solution for this?

Hi @Pratiksha,
Yes we got the solution this was happening due to a .net patch , which had removed/uninstalled from the VM control panel.
Patch name KB4054852 should not be there in prod vm as it hinders the ui studio. hope it will help you as well .let me know if you still face this issue after removing the .net patch.

Raj kumar

Hi tarunch23,

Go to the application and access it’s Properties panel.

Change the Dropdown value in “Run” to Maximized and then click on “Apply”.

The window will always open full screen and will have focus.

P.S : You’ll require administrator privileges to make these changes. You can use this for any application which gives you problems while trying to get it in focus.

Hey @rajait07 , can you explain me more in details. I also having same issue.

I cant make an IE browser to come in front for the life of me if the windows 10 start menu is in front, i have a simple open browser activity navigating to any site and inside as first activity i tried show window, maximize (with and without minimize first), invoke method (bringtoforeground), send hotkey windows up, windows+d, and nothing works…

I hope this helps:

The workaround to this is to minimize the window using the Attach Window and the Minimize Window Activities and then use the Browser activity to open the window in the foreground.

Here is a screen shot of my Process.xaml. It works with two Browser applications, and one of them is a terrible application that needs to have the Popup Visible for the process to move forward.

You can see that the “Good Application” window is minimized to get out of the way of the “Bad” window and once the work is done with the Bad window, the Good Window is brought back up, and further work on the Good window is resumed.

There is no activity to specifically Minimize/Maximize Browser windows - therefore you have to use Attach Window activity to do this
When you use Attach Window, use the same selector that you used to open the Browser application using Attach Browser activity.
Or if you are using an Open Browser activity, then use an Attach Browser activity to get the selector and use it in the Attach Window to minimize or maximize the window

None of these user provided fixes work reliably. And even if they did I should not have to make a multi-step process like Andy outlines to open a simple browser window.

I’d like to ask is the UI Path development team has made any progress on this issue. Opening a useable browser window should be RPA 101.

I see that this is a bit of an old question, but I’ll post a solution that has worked quite well for me when having multiple browser windows open:

The key here is to use a Send Hotkey Activity that sends Win+Up as the first Activity inside the Do-sequence of an Attach Browser Activity. This will bring the browser-window in question to the foreground.

Hope it can be of use to someone.

1 Like