Rx Object Path depends on how app was started?
Posted: Mon Apr 22, 2013 11:28 pm
I have a small whetstone application to verify testing of winform controls and widgets work / don't work within an application which is much simpler than our commercial winform app that represents man-decades of software development.
if the testing code does not work with winform control within the the whetstone app, that that same testing code will certainly fail when interacting with the same type of winform controls within the commercial app. The name of the simple app is Winform Whetstone.
If the whetstone app is started within a C# program with the Thread.Start(ProcessInfo) method then the Spy states the Rx path of the Close button of the main form is:
/form[@title='Winform Whetstone']/titlebar/button[@accessiblename='Close']
If I start the whetstone application from the operating system by double clicking on the directory entry then the Spy reports the Rx path of the close button of the main form is:
/form[@controlname='Cognex.TA.WinformWhetstone']/titlebar/button[@accessiblename='Close']
Why is this? The EXE has not changed in any way, yet Spy cannot find the ControlName property and uses the Title property instead?
I would prefer the second Rx path be used since the control name and accessiblename properties are language invariant and don't depend on the English text: "Winform Whetstone", for object identification.
I get a similar behavior for the Minimize button as well.
This erratic identification is problematic as I am using the existence of the Close button of the main form as a proxy to question: "Has the application started successfully." Button exist then yes, the application has started.
if the testing code does not work with winform control within the the whetstone app, that that same testing code will certainly fail when interacting with the same type of winform controls within the commercial app. The name of the simple app is Winform Whetstone.
If the whetstone app is started within a C# program with the Thread.Start(ProcessInfo) method then the Spy states the Rx path of the Close button of the main form is:
/form[@title='Winform Whetstone']/titlebar/button[@accessiblename='Close']
If I start the whetstone application from the operating system by double clicking on the directory entry then the Spy reports the Rx path of the close button of the main form is:
/form[@controlname='Cognex.TA.WinformWhetstone']/titlebar/button[@accessiblename='Close']
Why is this? The EXE has not changed in any way, yet Spy cannot find the ControlName property and uses the Title property instead?
I would prefer the second Rx path be used since the control name and accessiblename properties are language invariant and don't depend on the English text: "Winform Whetstone", for object identification.
I get a similar behavior for the Minimize button as well.
This erratic identification is problematic as I am using the existence of the Close button of the main form as a proxy to question: "Has the application started successfully." Button exist then yes, the application has started.