Used "Get Text" to extract a variable from pdf,but it is not opening the particular pdf file from the folder, it says cannot fond the ui element


#1

Gettng the below error, Can you please guide me on this?

An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
UiPath.Core.SelectorNotFoundException: Cannot find the UI element corresponding to this selector: ---->
System.Runtime.InteropServices.COMException: Cannot find the UI element corresponding to this selector:
at UiPath.UiNodeClass.FindFirst(UiFindScope scope, String nodeID)
at UiPath.Core.UiElement.FindFirst(FindScope scope, Selector selector)
— End of inner ExceptionDetail stack trace —
at System.Activities.Statements.Throw.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

Main.xaml (6.7 KB)

Capture


#2

I checked your workflow. You are not opening the PDF file anywhere. Get text can read the element only if it exist. That’s why error says selector not found. So open the file using run command or open application activity.

However, the best approach for this case is using “Read PDF” activity. If you don’t find it, you need to goto manage packages and install Uipath.PDF.Activities.


#3

Thanks for replying @vivek_Nalashaa

I used read pdf activity , still showing the same error, not sure what did i miss …

I also tried Start process, its opening the pdf on the scree, but some how its not performing the extraction


#4

If you are using get text, use Open application to open the PDF first.

Main (6).xaml (6.9 KB)


#5

Hi Vivek,

I tried using open application , but shows invalid selector,
The pdf application opens now, but its isn’t opening the pdf file i want to read from
selector

this is the latest midified file, not sure what’s the issue , can you please help.
Main.xaml (8.3 KB)


#6

Please try using Start Process with PDF File Path. I have given in the previously attached workflow.


#7

Yea, i tried that, shows cannot find UI element corresponding to this selector error.
I ran your xaml file only , but the same issue is occuring.


#8

Is Start Process activity gives you error?


#9

yes, its not able to read that particular content from pdf some how


#10

In exception window, click details button and send the screenshot.


#11

Hi Vivek,

It worked , tried to add the get text again, and it worked .

Thanks a lot :slight_smile:


#12

Great. :grinning:

Please mark the solution as solved.


#13

Hey Vivek,

The bot is running fine, but every time i close the application and open the next day, i get the same previous error,
I have to then redo the get text and then run.

Is there any way i can save these changes at once ?

Thanks


#14

Open the selector of get text, click repair and indicate the Element again.


#15

ui

It still behaves the same.even if i do repair.

The issue is occuring every time, i need to set the pdf settings too, so that i can indicate the element again using repair.


#16

Change the PDF accessibility setting to always make it readable. Please refer the below post.


#17

Hi Vivek,

I have done this but,

once i close Acobat Reader, it can no longer find the element. I have to re-open Acrobat Reader, and then re-select the options once again and leave Acrobat Reader open for it to work.

Is there any way that i can just do the changes once and dont have to keep selecting every time i close and open adobe reader?


#18

If the id have some pattern, you can use Read pdf text activities and Match (Regex) activity.


#19

Sorry , I couldn’t get u here?


#20

The variable that you need to extract have any pattern ?

If it have some unique pattern, then we can extract easily using Match activity.