English 中文(简体)
测试自动化-Win32应用程序-白色/UI自动化-识别对象的问题
原标题: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");

即使间谍看到了孩子们,收藏品还是空的。

  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. .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.

关于控件,您确定正在处理的控件具有Name属性吗?也许,这是一个只能通过ValuePattern而不是Name获得的值?





相关问题
Selenium not working with Firefox 3.x on linux

I am using selenium-server , selenium rc for UI testing in my application . My dev box is Windows with FireFox 3.5 and every thing is running fine and cool. But when i try to run selenium tests on my ...

Best browser for testing under Safari Mobile on Linux?

I have an iPhone web app I m producing on a Linux machine. What s the best browser I can use to most closely mimic the feature-limited version of Safari present on the iPhone? (It s a "slimmed down" ...

Code Coverage Tools & Visual Studio 2008 Pro

Just wondering what people are using for code coverage tools when using MS Visual Studio 2008 Pro. We are using the built-in MS test project and unit testing tool (the one that come pre-installed ...

Is there any error checking web app cralwers out there?

Wondering if there was some sort of crawler we could use to test and re-test everything when changes are made to the web app so we know some new change didn t error out any existing pages. Or maybe a ...

热门标签