I want to control a third party program. In particular to launch it, send a key to select a menu item, make a selection from a list box, send another key and then wait until the value in a lable / caption changes.
Then do it again!
It seemed to me that White would do this very nicely. But I'm struggling to get anywhere with it.
My code such as it is looks like this
application = Application.Attach(ProcessID);
window = (White.Core.UIItems.WindowItems.Window)application.GetWindow("MainWindowName", White.Core.Factory.InitializeOption.NoCache);
White.Core.InputDevices.AttachedKeyboard keyboard = window.Keyboard;
My first problem is that it takes some minutes to return from the GetWindow. So long in fact that I thought the program had hung (until I used patience instead of my normal approach).
My second problem is that the three calls to Keyboard methods result in
A first chance exception of type 'System.InvalidOperationException' occurred in UIAutomationClient.dll
I don't know if I'm being dim or if White won't work with the program (I expect the program is written in C++ or VB - it's the latest version of something that's been around for ages). I'm not clear on if it should work with all windows programs and
or if there are some constraints.
So wrong tree or wrong dog?!
Any help most gratefully received!