cancel
Showing results for 
Search instead for 
Did you mean: 

Spy PDF

AndriBernet
Level 2
Hi I'm trying to spy one line of text in a PDF document (document contains only one page), using Adobe Reader Version 10.1.14, which is perfectly recognized by the Accessibility mode. But unfortunately I'm getting the following error: "There was an error during the spying operation. Details: System.ApplicationExcpetion: The window spied was not found in the model at BluePrism.AMI.clsAMI.Spy(clsElementTypeInfo&elementType, List`1&identifiers) at Automate.frmIntegrationAssistant.HandleSpyOrLaunchClick(Object sender, EventArgs e)" Did anyone experience this error as well? If you have any idea how to solve this issue, every help is appreciated. (System requirements: Win 7, 64bit, Blue Prism version 4.2.19) Many thanks, Andri
11 REPLIES 11

Hi Andri, The issue arises because of the way that Adobe Acrobat (versions 10 and 11) runs two processes when it is launched. When Acrobat Reader first launches it uses TWO processes - both processes are called ""AcroRd32.exe"" (which can be seen using Task Manager). If Acrobat Reader is launched by Blue Prism then there is no way to differentiate between the two processes. Blue Prism therefore defaults to the one that has the focus, which happens to be the Splash Screen. As the splash screen does not expose all of the elements (it hides them) then these elements cannot be spied at that time. You can see this if you click the ""Show Invisible Elements"" checkbox in the Application Navigator screen at the point where you can only spy the three ""window"" elements. However, if the Acrobat Reader application is already running and you configure Blue Prism to attach to the process, you can supply the Window Title of the main screen (""Adobe Reader""). This allows Blue Prism to be able to correctly identify which AcroRd32 process contains the elements, and you will therefore be able to spy these elements because they have been exposed. One method to achieve this is to have one Business Object that simply launches Adobe Reader. Your second Business Object then calls this, and thereafter it can Attach to the process and spy the elements. Hope that help you, Chris McDermott.

Hi Chris McDermott, I am unable to capture PDF Object Properties(Spy PDF) using surface automation,win32 and we tried above solution that you provided but still unable to capture the PDF object. Adobe Reader :11.0(AcroRd32) Method tried: **If Acrobat Reader is launched by Blue Prism then there is no way to differentiate between the two processes. Blue Prism therefore defaults to the one that has the focus, which happens to be the Splash Screen. As the splash screen does not expose all of the elements (it hides them) then these elements cannot be spied at that time. You can see this if you click the ""Show Invisible Elements"" checkbox in the Application Navigator screen at the point where you can only spy the three ""window"" elements. However, if the Acrobat Reader application is already running and you configure Blue Prism to attach to the process, you can supply the Window Title of the main screen (""Adobe Reader""). This allows Blue Prism to be able to correctly identify which AcroRd32 process contains the elements, and you will therefore be able to spy these elements because they have been exposed. Thanks and Regards, Mohammed Nissar

Hi Mohammed, I know we can interact with Acrobat using Active Accessibility mode, but you mention using Region Mode (Surface Automation) which essentially means working with pictures and doing matches to locate areas of the target application. What is it you're trying to achieve with the PDF object? Are there some specific parts or actions you need to interact with? Regards, Chris.

Hi Chris McDermott , I am trying to capture ""Scaned image PDF"" and followed below steps. step 1:Create Business Object step 2:Launch the application by using application modeller(Adobe.11.0,AcroRd32) while capturing the PDF Object properties using ""Surface automation region mode"" and getting below error message Error message: There was an error during the spying operation. Error Detail: System.ApplicationException: The window spied was not found in the model at BluePrism AMI.clsAMI.Spy(clsElementTypeInfo& elementType, List`1& identifiers) at Automate.frmIntegrationAssistant.HandleSpyOrLaunchClick(Object sender, EventArgs e) Thanks and regards, Mohammed Nissar

Hello Mohammed, You said ""while capturing the PDF Object properties using ""Surface automation region mode"". This gives me a hint about the way you are working with this document.. Adobe describe the following ways in which Windows applications can interact with their product's documentation objetc model (DOM): ""● On the Microsoft® Windows® operating system, Acrobat and Adobe Reader export PDF content as COM objects. Accessibility applications such as screen readers can interface with Acrobat or Adobe Reader in two ways: ● Through the Microsoft Active Accessibility (MSAA) interface, using MSAA objects that Acrobat or Adobe Reader exports ● Directly through exported COM objects that allow access to the PDF document’s internal structure, called the document object model (DOM). The DOM and MSAA models are related, and developers can use either or both. Acrobat issues notifications to accessibility clients about interesting events occurring in the PDF file window and responds to requests from such clients."" This is from the document ""PDF Accessibility API Reference"" which is available here: http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/access.pdf When you are using the Region Mode you are only comparing a picture ""we call it a ""region"") with another picture (e.g. a picture of some part of your PDF document). You are not interfacing with the PDF document's object model in that spy mode. That is why the error is reporting ""The window spied was not found in the model"". To interact with the PDF's DOM I suspect you will need to access it using a spy mode such as Active Accessibility. With regards, Chris.

Hi Chris, We were trying to do the same but still are not able to access any features of any PDF using Adobe Reader. The same error keeps on popping up again and again. Rather, we tried opening the pdf file using Internet explorer(or any other browser you may have) and then could complete the process. Could you please guide us on this?

Hi If you have a specific issue that you require support with, could you please raise this by emailing support@blueprism.com, including full details of the exact error you are receiving, along with any other log files/screenshots that may be relevant, and in this particular instance, a copy of the object(s) you have created, and the version of Acrobat Reader you are using. This way your query will be logged with an Incident ticket and tracked, with guaranteed responses. Whilst we do our best to monitor these discussion forums regularly here at Blue Prism, the purpose is mainly a place for the User Community as a whole to discuss and assist with ideas and techniques related to using Blue Prism software. Best Regards Sam

michel_lazzari
Level 2
Hi Have you found a possible solution for your problem? I am trying the same thing and the same error occurs in both spying mode's (Accessibility/Region) Best Regards Michel

Jean_AnneGarcia
Level 2
Hi! I also have encountered a lot of issues about spying. When this error occurs ""There was an error during the spying operation"", I always do re-installation and it does resolve this issue for me.