cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Shashankpuli
Helper II
Helper II

Problem while executing action 'SendKeys'. Failed to send keystrokes [Only in Unattended RPA mode]

Hi Experts,

 

I'm getting following error  while running in Unattended mode.. In attended mode its working fine. 

error : Problem while executing action 'SendKeys'. Failed to send keystrokes.

 

I have tried Send text as hardware keys  On & Off > Any suggestions ??

Shashankpuli_0-1621538808324.png

 

 

15 REPLIES 15
ychen
Frequent Visitor

Hi @Shashankpuli, were you able to find a solution to that? I am facing the same problem as well when running in the unattended mode.

Hi @ychen ,  I did not and raised ticket to Microsoft support team few days back and they are investigating on this issue. Ill post the solution once I get update from them.  

@ychen solution provided from Microsoft, I did not tried yet. Hope this is helpful for you. 

 

Solution: In some scenarios, Power Automate Desktop may run unattended flows in a lower resolution than the one used to develop the flows. As a result, some UI elements could be hidden from the screen and cause flows to fail.

To change the resolution in which unattended flows are run:
Navigate to C:\Program Files (x86)\Power Automate Desktop and open the UIFlowService.exe.config file.
Set the value of the Microsoft.Flow.RPA.UIFlowService.ScreenDefaultResolutionEnabled key to true.
The appropriate keys in the UIFlowService.exe.config file.
Change the values of the following keys to the proper screen resolution width, height, and scale, respectively:
Microsoft.Flow.RPA.UIFlowService.ScreenDefaultResolutionWidth
Microsoft.Flow.RPA.UIFlowService.ScreenDefaultResolutionHeight
Microsoft.Flow.RPA.UIFlowService.ScreenDefaultResolutionScale
Restart Power Automate Desktop. 

 

Thank you @Shashankpuli, I will try that next time.  

Anonymous
Not applicable

Did we get the right solution from MS support team? because I don't think the issue is related to lower resolution. I am not getting any error like "Failed to send keystrokes" but my keys are not passing to the element.

@Anonymous 

Did you use Focus Window to activate the window prior to sending keys?

Before sending keystrokes to an open application, use the Focus window action to activate the respective window.
Automate applications using keyboard shortcuts - Power Automate | Microsoft Docs

Anonymous
Not applicable

Thanks @yasunm02 

 

Tried to bring the window to the front by using "Focus Window", but still my keys are not passing to the system.

 

Please refer the screenshot

SanthoshC_0-1630471530874.png

 

 

 

ablevinsalix
Regular Visitor

@Shashankpuli or @Anonymous did you find a resolution for this? I'm wondering if I'm have the same issues as you are.

 

Thanks

yoko2020
Responsive Resident
Responsive Resident

If it can be solved using ui automation or image automation, please avoid using sendkey because it is hard to trace/debug.

 

Sendkey will drop on any windows which got focused when the sendkey action executed.

Anonymous
Not applicable

No @ablevinsalix, still the issue remains.

Anonymous
Not applicable

Thanks @yoko2020, but I was unware of these kind of issue in "Send Keys" with unattended mode. Already spent more than a week to develop this solution and I can't go back and change all the Send Keys actions.

yoko2020
Responsive Resident
Responsive Resident

@Anonymous 

You must change, or it will haunting you forever. Trust me.

PDATiger
New Member

at year 2022, still has this issue.

keystroke sends perfectly fine in the attended mode but in unattended mode, it usually mis-send a key or 2 (not always), and sets the whole thing off.

Correct. It is such a shame, the same PAD flow works fine in attended mode. Considering there is so much licensing fees involved in unattended bots, Microsoft should be looking at these issues carefully and rectify them urgently. I have spent 2 days trying to fix one small problem. Its is extremely frustrating.

luigobots
New Member

Hi all, did anyone find a solution to this issue please? Send keys works perfectly in attended mode in my flow but switching to unattended fails. Thank you. 

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Top Kudoed Authors
Users online (3,426)