Invoke.exe says element is Invokable but it's not in code.

Feb 8, 2011 at 6:49 PM

Hello All, I'm a total newb with White and the Automation stuff so if my question doesn't make any sense I can try to elaborate.
I've got an AutomationElement (ae) that I want to Invoke. It's a ControlType.DataItem.
It has these patterns:

SelectionItemPatternIdentifiers.Pattern
TogglePatternIdentifiers.Pattern

And ae.GetCurrentPropertyValue(AutomationElement.IsInvokePatternAvailableProperty) returns False

However, Inspect.exe (from the Windows SDK) not only says "IsInvokePatternAvailable:    true", it can actually do it from the Action menu. There is an item Invoke.Invoke.

I compared the RuntimeId from my code and Inspect.exe and both are looking at the same element. Is the something special I might need to do for ae to offer up the Inoke pattern? Or some syntax other than CType(ae.GetCurrentPattern(InvokePattern.Pattern), InvokePattern).Invoke()?

Many thanks for the help!
Paul