Test Script Generator

Apr 15, 2008 at 2:16 PM
Edited Apr 15, 2008 at 2:16 PM
Hi,

There is a sample in the WPF SDK which shows how to:
1. Launch an application.
2. Listen to UI Automation events and 'record' them as they get fired (i.e. as you navigate around the screens in the launched application).
3. Generate a script to be able to replay the same sequence events (e.g. as part of a test).

The sample is available here:
http://msdn2.microsoft.com/en-us/library/ms771275.aspx

Basically, it hooks into the UI Automation events using calls like Automation.AddAutomationEventHandler and Automation.AddAutomationPropertyChangedEventHandler.

My question is, how can I do the equivalent in White ?
I've looked through the source and I can see that you are obviously making use of these event handlers yourself (e.g. in HookEvents method of UIItem descendants) but I can't see what API I need to use to generically listen to the White UserEvents which are wrapping them.
Essentially, I want to listen to all possible events (at least supported ones) on all UI elements - can you give me a sample of how to do this?

BTW so far I'm very impressed with White - I was about to start writing something similar myself but thank goodness I found this first !

Thanks,

Andrew
Coordinator
Apr 15, 2008 at 3:41 PM
Short answer you would have to wait a little for that.
There is whole lot to white than the core part which has been released. This should come out after next release. Currently I am busy documenting all this down. Code generation, VS plug-in, Recording, Pattern and other tool support are going to be part of it. Please bear with me for a while.
Since core was the right place to put the code related to events, you can see them in the code. But I havent documented about how to use it.
Sorry for the confusion.
Apr 15, 2008 at 4:49 PM
Cool - when do you expect the next release (not that I'm impatient!) ?

viveksingh wrote:
Short answer you would have to wait a little for that.
There is whole lot to white than the core part which has been released. This should come out after next release. Currently I am busy documenting all this down. Code generation, VS plug-in, Recording, Pattern and other tool support are going to be part of it. Please bear with me for a while.
Since core was the right place to put the code related to events, you can see them in the code. But I havent documented about how to use it.
Sorry for the confusion.


Coordinator
Apr 19, 2008 at 10:09 PM
This would be in release 0.16 one after next. I think it should be out sometime in mid-may.