cancel
Showing results for 
Search instead for 
Did you mean: 

Spy with UIA Process Id

ChristianPanhan
Level 6
​Hello,

when I spy an element in the application modeller using the "UI Automation Navigator" then many attributes gets recorded.
There is one Attribute I'm interested in:   UIA Process Id
Adding a new element using the Navigator and highligting it works fine.
But when I use the Process Id as a match criterion then I get the error message "No matching Windows found"

Does anybody know, why?
Can the Process Id-Attribute only be read and not used to find elements?

Thanks

------------------------------
Christian Panhans
Digitalisierung
BCB AG
------------------------------
2 REPLIES 2

Hi Christian,

The "UIA Process Id" attribute notes the Process Id assigned by your OS to the currently running instance of your application.

This can be seen in Task Manager on the 'Details' tab under the 'Pid' column:

11636.png


This Id is randomly assigned to the process running your application each time it is started, so we would not recommend using this attribute for matching your element in most cases.

As a test if you spy an element using UI mode then make a note of the 'UIA Process Id', then close/reopen the application and re-spy the element, you will see that this attribute has already changed.

------------------------------
James Roberts
------------------------------

​Hi James,

thank you for your recommendation of not using Process ID for matching elements in most cases.
But I'm still wondering why I get the message "No matching window found" when trying to highlight the element in application modeller just after spying it with having "Process ID" as match criterion enabled.
I mean, the Process ID does not change after spying because the application does not get closed.




------------------------------
Christian Panhans
------------------------------