Studio - Modern design - Cannot bring the target application in the foreground

Hi All,

I have created an object repository(Modern design) and Library for each activity in the Project, It runs in attended mode without any issue.

I have given Input mode for Use application browser as “Windows Message” and for click activity as “Simulate” .

Project works well in Attended mode whereas tried running from Orchestrator (VM disconnected) it throws the error as" Cannot bring the target application in the foreground".

Process : Bot has to open the desktop application and click “Ok” button from the pop up window (see images attached ) then continues with the login credential page.

Error : Bot is opening the desktop application but not clicking the “Ok” button from the pop up .

Can someone hlep me to resolve the issue ? TIA

I have done a couple of other projects successfully in the same instance in classic design that already deployed in production and perfectly working fine.


For now, can you check your UiPath run as service mode?
We can check it if UiPath.Service.Host.exe is running or not in TaskManager of OS.



I Have checked in my instance -->TaskManager under details tab. I found Uipath.Service.UserHost.exe

@divya.paul did the bot captures any screenshot when the exception occurs due to not able to click on OK


this error usually appears when your remote server has not an unnattended license, you have to check if your activities selector is not taking all of the options for example the image to avoid any exception

if you see in your click button you have configure it incorrectly, because the anchor that you used will change, in the top of the propierties panel you can see a message. Please just click the ok button without any anchor or image, just use your fuzzy selector o selector by default

also your application activity does not reference to the correct element, i think that your have to map again your selectors

hope it helps


1 Like


Your UiPath seems user mode. If possible, can you try to install it as service mode?
The following document will help you.


1 Like

I tried with your suggestion, removed anchor and it has run in unattended mode. I have another problem with Keyboards shortcuts, Bot need to enter the username in lthe ogin page
I have used SetClipBoard activity for holding the value from an argument and used Keyboradshort cuts for Paste the username in Textfield , I have given input method as " window messages".
Error : " Enter User Name: Cannot bring the target application in the foreground."
Can you please suggest me to resolve this issues?

Please use the simulate method for your window, also we can not test the automation in our own development server because this is not a un attended license

Remember that your need a unattended automation so we can’t use images, if your have anyone of your selectors with image you need to map it again just using the selector

Thanks for your reply. I am using a community edition with an object repository. Is that why I am unable to run in unattended mode? We have done a couple of projects in classic design and run successfully in both attended and unattended mode.


Studio 2021.10.5 - 2/2/2022
Community License
Per-user Installation

License Provider: Orchestrator
Activation ID:

Update Channel: Stable

Microsoft Windows Server 2019 Datacenter 64-bit

Exactly we can’t do that from community, you need to run it in a machine that has unattended license.

Maybe you could run automations without UI interaction and that is why you was able, but now you are using UI automation, for unattended run we need the license



I am also facing the same but I did not get exactly what should I do to fix it?

Best regards,

Did you fix this?

From orchestrator clould i have downloaded pakcge and installed , i had enterprise license too , but still not working

For me its not running

use simulate or chromium API