Currently i am working on providing the Coded UI support for my custom control. I have implemented the Coded UI implementation as like the steps provided in the following link, https://blogs.msdn.microsoft.com/winuiautomation/2010/05/10/custom-ui-automation-providers-in-depth-part-1/ https://blogs.msdn.microsoft.com/winuiautomation/2010/06/04/custom-ui-automation-providers-in-depth-part-4/
I can achieve the Coded UI assertion. But i cannot able to check whether the provider is in play back mode or not? Because i have the following situation. i.e. if it is in playback mode i want to perform one operation otherwise default one,
if(Playback mode)
want to do some operationelsedo the default
This is the part of my code and my needed place to check that condition,
publicclassCustomUIAProvider:IRawElementProviderFragmentRoot,ISelectionProvider,IScrollProvider{publicIRawElementProviderFragmentNavigate(NavigateDirection direction){switch(direction){caseNavigateDirection.NextSibling://here i want to check my condition}}}
The below code is the root code for triggering the provider for Coded UI assertion and playback, this code has been written incontrol WndProc method,
protectedoverridevoidWndProc(refMessage msg){switch(msg.Msg){case WM_GETOBJECT:
msg.Result=AutomationInteropProvider.ReturnRawElementProvider(Handle, msg.WParam, msg.LParam,this.Provider);return;}}
Case The case is that Navigate method is always triggering for both the operations (Playback mode and Assertion mode). So i cannot find the scenarios.
Can anyone help on this?
Regards, Neelakandan