Activate Application sometimes throws exception

riderc1

Member
I am trying to figure out why my Blue Prism process is throwing an exception sometimes. It is always in the same location - one of my steps performs an "Activate Application" - this is a Win 32 application. I have launched Application Modeler and checked my spy definitions - they are working fine when I click "highlight" on the element. Plus, this has been running since last July and works ~98-99% of the time.
The application has a thick client running on Windows 10. The thick client does access a remote server to get its data. I won't get too technical, but it runs a report every day for each of the 12 months. In total, it runs about 80 times a day.
Basic process flow after it logs in and starts the application (in a loop):
1) Activate Application (the main screen of the Win32 application)
2) Fills in values and clicks a "run" button to get the report data. Each report takes different amounts of time - typically, in the rang of 15-30 seconds.
3) Saves the data to disk. This takes about 10 seconds.
4) goto step 1 until complete.

I initially thought that the reports were taking too long and a timer expired. However, the exception always says:
Message: Failed To perform Step 1 In Navigate Stage 'Activate sql window' on page 'Daily Spots SQLWindow' - Unable to match any windows with the query terms
Everything in the action step looks correct. The window (title is called SQL Window) is spied correctly and matches with Application Modeler. Most of the time, my process works as expected. It's just every now and then it fails on the Activate stage (and I'm using Activate Application as the action).

Any thoughts on what I can check? Perhaps, I can get rid of the Activate Application step. The next step after that is to put in text to an input box in the Win32 application (basically a SQL query). After that, it will click the "run" button to execute the query.
I think I originally added the Activate Application to make sure the window was in focus. If I recall, this system was occasionally getting pop-up messages from other applications (like virus checker) that caused problems. We are using a different vendor for antivirus, so this may not be an issue any more. However, seems like Active Application should work always. Even if it is already activated. Why would it not be able to focus it?

I have also observed it running today when the exception was thrown. Everything looked very normal and no pop-ups. The application looked like it was focused.
 
Last edited:

tomahawk1

New Member
My tips: minimize attributes in application modeler. If it's a windows app, maybe just window title could be enough? If title changes, use wildcard or dynamic value. Before activating window, check if process exists (Utility - Environment), then read "is connected" status of root element and lastly put small arbitrary wait stage (e.g. 2 second) before Navigate / Activate Application. Maybe it'll help.
 
Top