I’m looking for alternative for existing tests written in QTP for my Win32 application written in Borland C++. My candidate is White which based on UI Automation because it’s native solution, I can create my tests using .NET/C# and easily integrate it with nUnit and Hudson.
White http://white.codeplex.com
MS UI Automation http://msdn.microsoft.com/en-us/library/ms747327.aspx
UI Verify http://uiautomationverify.codeplex.com
I use UI Verify as a spy to identify properties of objects I want to find in my tests. More or less when I can see something in the spy, I can find it using UI Automation/White. Generally I don t have much problems with recognizing objects but when I try to search some content inside the tab contained in Tab Panel or try to see MenuItems of Menu bar then the problem appears.
UI Automation/UI Verify works wired. When I run UI Verify (1.0 version) I see that objects can be registered properly only then when I set Focus tracking option and click on target objects or change the keyboard cursor on them. Otherwise it s impossible to find them. UI Verifier can show me children of my tab panel then. But I can’t find them using UI Automation/White. This is example code:
Tab tab = window.Get(); ITabPage tabPage = tab.SelectedTab; AutomationElementCollection newCol = tabPage.AutomationElement.FindAll(TreeScope.Descendants, Condition.TrueCondition); window.Get("buttonName");
即使间谍看到了孩子们,收藏品还是空的。
- Does any of you have some experience with White/UI Automation library that he/she would like to share with me?
- I want to implement the tracking feature from the spy to my tests. Can you help me with that? I m trying to study the code of UIA Verify spy. I think that there are two classes responsible for catching the objects: FocusChangeListener and FocusTracer - this is the code:
http://uiautomationverify.codeplex.com/SourceControl/changeset/view/9992#214260 http://uiautomationverify.codeplex.com/SourceControl/changeset/view/9992#214192
Requirements: 1. Windows SDK 2. .NET 3.5 3. White 4. UIA Verify code
- Do you have any better alternative for White/UI Automation?
R