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

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

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.

Thanks for replying @Vivek_Arunagiri

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

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

Main (6).xaml (6.9 KB)

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)

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

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.

Is Start Process activity gives you error?

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

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

Hi Vivek,

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

Thanks a lot :slight_smile:

Great. :grinning:

Please mark the solution as solved.

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

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

1 Like

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.

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

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?

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

Sorry , I couldn’t get u here?

The variable that you need to extract have any pattern ?

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