cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Daniel23
Frequent Visitor

Populate text field in window (UI automation) failed when printing webpage as PDF

Hi,

 

I am having trouble with getting Power Automate Desktop to populate text field in window. The problem seems to only occur on our unattended bot server (windows server 2019). The steps of the flow is as below, and my problem is with step 4. The process outlined below, will have many iterations (+ 100 each run).

 

1. open/navigate to webpage using chrome browser

2. press CTRL+P (send keys)

3. in the window appearing (where you can select printer, ect.), I press "Save".

4. In the "Save as" window, I need to populate the text field where you enter the path and file name for the PDF you want to save.

 

Step 4 is for some reason very unstable and fails a lot. The strange thing here is that if the robot somehow can find the UI element on the first iteration, then it will have no problem during any later iterations of the run. However, every time we start the robot again, this step has a high risk of failing.

 

Things I have tried:

  • Use screenshots to see the desktop of the server at time of failure (everything looks ok)
  • Check if any of the UI element selectors are dynamic.
  • Have more than 1 UI element selector available.
  • Used both "Click on UI element" and "Focus text field in window" (with same outcome)

 

I get the feeling that Window elements opening as part of a webpage/Web element (i.e. go to webpage and press CTRL+P opens a window element) is somehow problematic for PAD, when running on Windows server (?). I say this, because for step 3 we were also unable to use "click UI element in window" when needed to press "Save".

 

Anyone else having problems with this, in a similar setup?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Daniel23
Frequent Visitor

Update on this.

I think it solved it by doing the following:

Terminate all proccesses with name 'chrome' - and then include a 10 sec wait just after I opened the chrome window. 

View solution in original post

8 REPLIES 8
VJR
Super User
Super User

Hi @Daniel23 

 

What is the error that you get when it does not work?

 

Also could you try giving a Wait of few seconds just to give it some time to allow the SaveAs dialog box to open and be identified.

Daniel23
Frequent Visitor

Hi @VJR 

 

The error message is: Action name: Populate text field in window
Error Message: Failed to write in textbox (textbox wasn't found)

 

Below you can see the code for the step. As you can see, I both have wait for window and a delay of 2 seconds before it attemps to populate text field. I also have enabled "on error" on this specific step and have it do a few retries.

PADerror.png

VJR
Super User
Super User

HI @Daniel23 

 

Could you please show the selectors for the textbox.

 

Do make sure no selectors with filenames in the window title or within any other attribute are selected.

 

Daniel23
Frequent Visitor

Hi @VJR 

 

Selectors are:

 

PADerror1.png

VJR
Super User
Super User

HI @Daniel23 

Not sure which 3 selectors you are displaying.

 

- Double click on the yellow highlighted UI element on the Right hand side in PAD window.

VJR_1-1634814727522.png

 

 

- Then double click on the yellow highlighted (below).

Then it will show the "Selector builder" box as below.

Go into each of the check boxes on the left hand side and see whether anything specific to a file name is selected. Why is Edit filename 3 shown in your screenshot?

 

 

VJR_0-1634814563475.png

 

 

The Name should not be ticked so that it becomes available to all file names.

 

VJR_2-1634814815763.png

 

 

That way please check all the selectors if they are made specific to a particular element. If so they need to be made generic.

Daniel23
Frequent Visitor

Hi @VJR 

This is the step that fails. It uses UI element called " Edit 'file name:' 3 "

 

Daniel23_0-1634815387846.png

For this UI element, I have added 3 selectors (my previous image) to help identify the field (I have manually added 2 more selectors, than the one that is created when you add the UI element).

I will try your approach and deselect Name = File name: as you suggest.

 

However, I thought this referred to what I have highlighed below:

Daniel23_1-1634815685122.png

 

Thank you for the suggestion. Will report back if it works 🙂

 

Daniel23
Frequent Visitor

Hi @VJR 

 

Unfortunately, it did not solve my issue. I can add that it seems to be related to any window UI element of the Chrome browser. Either it can find all of them or none of them.

Daniel23
Frequent Visitor

Update on this.

I think it solved it by doing the following:

Terminate all proccesses with name 'chrome' - and then include a 10 sec wait just after I opened the chrome window. 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

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

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Top Kudoed Authors
Users online (3,281)