Workarounds
How to work with button clicks where object disappears (Login screen)
Common issue is that user clicks Login on popup, which disappears on success and launches the main window.
Automation UI / MSAA talks directly with the program being monitored via Windows messages, so no information can be pulled out about the button if the monitored program freezes or lags.
This causes the event to loose information and give result like:
"utcDateTime": "2018-07-03 14:05:00", "collectionDelayMs": "0", "collectionTimeMs": "1031.23", (1000 ms delay in fetching information about button, because program under test freezes) "typeID": "5", "type": "LeftMouseClick", "name": "Login", (Sometimes manage to capture correct name, but can be missing or incorrect if to long time has gone since event was detected) "point": "1076x549", "role": "client", "state": "invisible", "processId": "19284", "processName": "TestApp.exe"
Workaround is to use the new win32_name property, this information is pulled immediately and is the correct text.
<!-- "timestamp": "1531386716", "utcDateTime": "2018-07-12 09:11:56", "collectionDelayMs": "0", "collectionTimeWin32Ms": "0", "collectionTimeMsaaMs": "1031.23", "typeID": "5", "type": "LeftMouseClick", "win32_name": "Login", "point": "1138x635", "role": "client", "state": "invisible", "processId": "20272", "processName": "TestApp.exe" --> <Rule id="102" type="LeftMouseClick" debug="false"> <RuleCondition property="win32_name" match="equals" value="Login" /> </Rule>
How to work with popups with dynamic or empty names
Issue is that some dialog popups doesn't have an title or is dynamic order number, we activate UIAutomation capturing of AutomationId on MouseClicks and ObjectShow events to workaround the issue.
Currently all events are received and data collected via Accessible MSAA API, so UIA collection gives extra overhead and is currently limited to Mouseclick and ObjectShow events.
<!-- "timestamp": "1531400662", "utcDateTime": "2018-07-12 13:04:22", "collectionDelayMs": "5118.1", "collectionTimeMs": "41.001", "collectionTimeAccessibleMs": "11", "collectionTimeAccessibleParentMs": "4", "collectionTimeWin32Ms": "0", "collectionTimeUIAutomationMs": "20", "typeID": "12", "type": "ObjectShow", "role": "window", "eventClass": "WindowsForms10.Window.8.app.0.5c39d4_r35_ad1", "firstNonChildWindowClass": "WindowsForms10.Window.8.app.0.5c39d4_r35_ad1", "processId": "23352", "threadId": "11436", "processName": "TestApp.exe", "parentName": "Desktop", "parentRole": "client", "uia_automationId": "frmTestPopupWindow", "uia_frameworkId": "WinForm", "uia_className": "WindowsForms10.Window.8.app.0.5c39d4_r35_ad1" --> <Rule id="201" type="ObjectShow" debug="false"> <RuleCondition property="role" match="equals" value="window" /> <RuleCondition property="eventClass" match="contains" value="WindowsForms10" /> <RuleCondition property="parentRole" match="equals" value="client" /> <RuleCondition property="uia_automationId" match="equals" value="frmTestPopupWindow" /> </Rule>