Unable to use PowerBI, (.pbix) file to Refresh report and save | error : Use Application: pbidesktop.exe: Cannot bring the target application in foreground because the Windows session is locked

Hi All,

I have been working on this automation that generates a report from an online ticketing tool and then stores the excel report in a folder, from where the PowerBI file has to be opened. Once open, refresh button needs to be pressed. Followed by saving the file.
While running the automation from orchestrator, my job is failing with the below error.
“Use Application: pbidesktop.exe: Cannot bring the target application in foreground because the Windows session is locked.”

I am running this task in a remote server in unattended mode. My all the other tasks like manupulating excel sheets, browsing to a location in the web, etc is working. Except for PowerBI.

FYI, when I am logged in to the remote server, the process completes normally.

Please help, as I am stuck resolving this issue for over 16 hours now.

Thankyou.

Please share the screenshot of error in the remote sever.

Hi Sree Krishnan,

As mentioned earlier, I am not seeing any error while running the sequence while I am logged in and the task is completing successfully. But in unattended mode, the same is not happening. Please find below the screenshot of the error available in the orchestrator log.


I ran another task, with minor changes, and this was the error for the second job

ok i understood what is the error .
In unattended mode , when your screen goes off then only this error comes.
So please make sure that your remote server is always ON means visible.

Please find below the sequence, for reference.
Main_test_powerbi.xaml (22.4 KB)

Hi Sree Krishnan,

Thanks for the response. I have other jobs running in unattended mode, that opens chrome, download excel reports, manipulate them, etc. with the same setup in unattended mode. Could you please let me know why the other tasks work but not this one?
Appreciate your replies! Thanks!

hello @jaya.das
As mentioned before your error is that the target application couldnt find in the foreground screen right?
that means whether the screen comes off or selectors issue …
Can you please check the selectors you have provided and while the error comes.

Hi @Sree_Krishnan_vellinezhi ,

Thanks. I am pretty new to UIpath, so I am unable to understand what will be the correct selector. Please find below the screenshots for the activity where the sequence is failing.

ok please send me the selectors which is existing and the selectors when the error comes

Hi @Sree_Krishnan_vellinezhi ,

I am facing the error for this selector. Here, I am trying to click on Home option in powerbi

You just click on open in ui explorer and add aaname and innertext attributes also

also send the screenshot when the error comes

1 Like

Hi @Sree_Krishnan_vellinezhi ,

I added aaname and innertext attribute, and ran the application. The jobs failed again at the same point.


This is the error, when the job fails, found from orchestrator.

actually you are working in remote server right ?/
so are you using cv screen scope activity
try with cv activities

1 Like

Hi @Sree_Krishnan_vellinezhi ,

Thankyou for all your help. To anyone that faces similar issues in future, here is what i did.
I noticed that, in my server, I had installed UIpath in usermode. You can check it out by going to task manager, and check for Uipath Service Host , If not present, you will need to uninstall the UIpath and install it back in Service mode (Recommended for Advanced Users → Unattended mode). Once done, create a new machine in your orchestrator, generate the machine key. And use the key in Uipath assistant to connect the same. After the connection is done, I was able to run the application with server locked but was facing issue when I had to close a dialog button after a process. For that, as @Sree_Krishnan_vellinezhi suggested, I used the CV activities for clicking the button. Thanks @Sree_Krishnan_vellinezhi , your suggestions really helped. Thanks again.

no mention its my job to solve the queries upto my knowledge

If your query is solved please give that as a solution

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.