StudioX: When getting text from PDF, I keep getting the error "Could not find the user-interface (UI)"

Hi all,

I am using a StudioX 2020.4.1 Community Licence.

Description of the issue:

I have multiple reports in .pdf format saved in a folder.

I have attached two reports here as samples. The reports are always in the same format.
FBUAgedVolumeReport.pdf (13.8 KB) FBUAgedVolumeReport_1.pdf (13.8 KB)

For each .pdf document, I want to capture the six numbers in the table (to be used in a different report later). To do this, I used the Get Text action under the Use Application/Browser resource.

However, when I run my project, I constantly encounter this error:

Get Text: Could not find the user-interface (UI) element for this action.
Possible solutions:
• Ensure application is opened and the UI element is visible on the screen at
execution time
• Edit the Target of the UI activity and use Validation to debug the issue.
• If needed, re-indicate the element as its properties might have changed
• Use “Check state” activity to check the application state before executing the action
• Increase the “Delay before” value to allow time to the application to render entirely
and become responsive

As far as I can tell, I have selected the UI Elements correctly, with consistent anchors. Attached is a .png of I selected the UI Elements together with the corresponding Anchors.

When I did the initial selections, I validated the selections before confirming.

When the error appears (i.e. for which UI element) also differs, depending on the values within each report.

Would appreciate it if anyone could help with this query.

Thanks and regards,
Jaime

can you narrow to one particular get text? i tried same flow using your first pdf with two get texts and is working fine

is the pdf file opening on another monitor?

Hi Horia,

Apologies, I don’t understand what you mean by narrowing to one particular get text. I require all the seven fields from the pdf documents that I marked. Can you show me what you mean by using two get texts only but still obtaining all the sven values that I require?

Yes, the PDF file opens on a different monitor. Would that cause issues? If yes, how would I be able to control it so that the PDF file opens on the same screen?

hello,

i was trying to say to narrow the error to one of the get texts activities. just do the wf with one get text and collect only one value from the pdf and if it works add the second one and run again and so on.
also check the scale of the display settings : try to use it at 100% , most of the people use by default 125% or 150%. just give it a try.
let me know how it goes.

Hi,

Thanks for that suggestion to run the workflow one text field at a time. Here are the steps I took.

  1. I changed the Properties for the Get Text actions to Continue on error = True, and then reran the entire workflow.
    At this point, I found that it is not one particular text field that is causing problems. Rather, it can be any of the number fields (excluding the date field).

  2. I then added some steps to change the zoom side to 100% (it defaulted to 153% on my screen) before the Get Text actions. I also revalidated the Get Text targets while the view size = 100% to be on the safe side. This helped in terms of narrowing the incorrect values captured/errors to two particular text fields, but there were still errors :frowning:

  3. I ran two workflows across the same reports. The only difference between the two workflows is that for the first one, I used a report dated 15 Apr 2020 as the reference for the Get Text actions, whereas for the other, I used a report dated 24 May 2020 as the reference for the Get Text actions. I get different results for the two workflows.

I attached the following documents here:

  • Results 15 Apr 2020.xlsx. This table shows the values that were captured from 29 reports, if I use the workflow with the report dated 15 Apr 2020 as the reference. The records highlighted in red are the ones that the workflow was unable to read, or read incorrectly.
    Results 15 Apr 2020.xlsx (14.0 KB)

  • Results 24 May 2020.xlsx. This table shows the values that were captured from the same 29 reports, but using the workflow with the report dated 24 May 2020 as the reference. The records highlighted in red are the ones that the workflow was unable to read, or read incorrectly.
    Results 24 May 2020.xlsx (14.4 KB)

  • Reports .zip file. These includes the two reference files, as well as the 29 reports I used.
    Reports.zip (416.1 KB)

Any ideas why the above is happening? It is weird that the accuracy of the capture changes depending on which report I use as an initial reference.

What else can I do to fix this?

when you say about zoom what do you mean?
i was talking about scale on the desktop.
image

change this to 100% or 125% if it’s higher. we found out that might be some problems because of this.

My desktop scale and layout is 100%.

image

When I open a PDF document in Adobe it automatically defaults to 153% on my screen:

This is what I mean when I said that I added steps to change the zoom size to 100%.
I tried to use a Keyboard shortcut step for Ctrl + 1 instead but that option kept throwing up errors so I added steps for the bot to select View > Zoom > Actual Size instead.

when you indicate the value do you have automatically detected any anchor?

No, I have to manually select the anchors.

adding several anchors for each field works better?
or if trying to change the framework while in indicate mode?

I have tried adding multiple anchors for each field, it didn’t make any difference. I’m not sure what you mean about trying to change the framework while in indicate mode; could you give more details/screenshots, please?

when you hit indicate in the small popup you have the option to hit F4 or F3 to change the indication mode.

same happens when starting the automation and the pdf files are already opened?
can you please try to close them all and then run the automation?

so i investigated a little deeper today this and i what you are trying to achieve is not possible in studiox yet: you are indicating a field in the pdf file that you whant to be read for each file in the folder, but in each file that field will have a different selector.
can you please try to eliminate the for each activity and add an app card for each pdf file you are using and use get text in each one of them :

  1. app card -> pdf 1
    -get text
    -get text
    -get text
  2. app card -> pdf 2
    -get text
    -get text
    -get text

try yo run the wf with the pdf files closed as per above commnet, since at some point we had a similar problem.
let me know.

The PDF files are not opened when I start the automation.

Using the different Indication modes doesn’t make any difference.

I don’t understand what you mean that each a field has a different selector in each file. The .pdf files are generated in the same identical format each time - why would there be different selector in a different file?

I’m sorry, I don’t understand what you mean by this. Are you saying that I have to specify each PDF file in my WF? The number of files in the folder are variable, with different names each time. Can you please send me a screenshot of what this suggested wf looks like in StudioX?

sorry for the back and forth. i managed to do your wf to work entirely automated.
so: basically your initial posted picture is just fine, but you need to make some adjustments:

  1. each get text make it save to “save for later use” and give it a unique name for each variable

  2. after all the get text from your initial picture, add write cell activities, 6 of them, each of them like this : what to write : use all saved values from above, each write cell uses a saved value, where to write: indicate in the first write cell for example : sheet1!A1 and for the rest of the write cells activities just modify the cell to be B1, C1, D1 and so on. And, very important on the each write cell activity select the option to increment. This way it will not overwrite the values in excel but write them in columns. Thats why you can’t use get text to directly write to the excel files: beeing in a loop it would overwrite the values and you would only get in the excel the last value.

  3. go back to each get text and hit “edit target” : it will open the indication screen. under the indicated value you will see a settings option, click that and will open the selector where you will see the entire name of the file and the value from that fileld: you need to replace the name of the file and the value with * to make it general and to make it work for each file. after that you will need to re-anchor and hit confirm. do that for each get text. this way you ensure that the selector is working fine for each file.

NewBlankTask182.zip (307.8 KB)

i attached the project done only for the first rows of value (3 get texts) where you need to change only the location for your files. you can also can check the selectors. let me know if you manage

==============

Hi,

Thanks for taking the time to investigate.

Unfortunately, the proposed solution still did not work. I will not pursue this query any further.