Exceptions in an unattended execution

We moved from V22 to V24 and facing exceptions in an unattended way. If we open the machine and run via orchestrator, the scripts work and no exceptions.

Following exceptions:
Exception: Invalid UI node.
Exception: The UiElement is no longer valid
Exception: The UI element is invalid. Make sure the target application is open and the element is on the screen.

We tried to add hard coded wait but no positive success. What are the issues?
how can we fix?

Could you please check if the updated version is installed in User Mode or Service Mode?
For Unattended Automation on VDIs, the Bot must be installed in Service Mode.

How can we check this?
Also, in an unattended execution, it works few times but get exception frequently. Strange behaviour.

Hi @pushkar.singh1

Might be resolution issue pls check these 2 > Match screen resolution and DPI settings.
and Revalidate selectors after upgrade to v24.

Happy Automation

Hi @Pushkar.singh1 There exists a potential for resolution to trigger the exception. You may verify this as well. According to your post, the Automation is functioning correctly in unattended mode with version V22; therefore, I believe there should be no Resolution error.

To check if your Robot is installed in Service Mode or User Mode, please refer to the link below:

After installation how to check if Robot in Service Mode or User Mode - Help / Studio - UiPath Community Forum

where are these options to verify?

I checked with the team, it is user mode.

For Unattended automation we need to install UiPath in Service mode in VMs.

Service Mode → Runs without user login (needed for unattended robots).

User Mode → Needs user login (only for attended robots).

It has been handled by another team and it is the same way since the beginning. I think it is not causing any issue with the exceptions.

Please check in other machines to confirm whether the UiPath is installed in service mode/ user mode. Where UiPath Unattended automation is running smoothly.

As per my knowledge UiPath should be installed in Service Mode in VM to run Unattended automations.

Hello @pushkar.singh1,

Follow this steps.

  1. Update UiAutomation package.
  2. Regenerate selectors using ‘Modern Activities’.
  3. Set ‘robot resolution’ in Orchestrator.
  4. Replace Delays with ‘Check App State’.
1 Like

Believe us, it is.
User mode does not work for unattended automations, it has to be in Service mode.
To be specific, in user mode the automation cannot log into the machine and render the display, the errors you see are caused by the display not being rendered so the screen effectively being off. Service mode is there to address that.
They are wrong if they stated it was always done in user mode.

1 Like

Sorry, my bad. I checked again and came to know that it is service mode only for unattended mode.

1 Like

We will try to change objects… classic to modern if it helps.

After upgrading UiAutomation package, it worked for us. Thank you very much. Much appreciated.

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