开发者

Test automation - Win32 app - White/UI automation - problem with recognizing objects

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");

the collection is empty even though spy see the children.

  1. Does any of you have some experience with White/UI Automation library that he/she would like to share with me?
  2. 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开发者_Python百科. .NET 3.5 3. White 4. UIA Verify code

  1. Do you have any better alternative for White/UI Automation?

R.


Could you, the R or YoYo, put your form compiled or in source codes (preferable without the internal logic) somewhere on a file share? I've never seen a control that'd be not caught using UI Automation if UIAVerify sees it. I saw such windows, which could be only caught with the Focus Tracking feature of UIAVerify. This case, such a window is untouchable by UI Automation search.

Regarding a control, are you sure that the controls you struggling with have the Name property? Maybe, this is a value available only by means of ValuePattern, not the Name?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜