编码的UI测试PropertyGrid [英] Coded UI Test PropertyGrid

查看:101
本文介绍了编码的UI测试PropertyGrid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我正在开发地图绘图(GIS)应用程序.我使用的是winform组件.WeifenLuo的对接框架工作在一些海关树形视图中进行,并且主要用于用户输入默认的PropertyGrid,其中带有十几个UITypeEditor和TypeConverters.我不在乎用户输入 因为我用属性标记了我的对象,并且所有工作都是由PropertyGrid完成的,就像在VisualStudio中一样.

现在,我正在尝试VisualStudio 2012中的UICoded测试.我很惊讶我能够在自定义树形视图上记录用户操作,并且它可以正常工作.但由于我使用的是PropertyGrid,因此在Preperty Grid下记录一些操作存在很大问题. 

例如,我有用于设置某些属性的UIType编辑器.此UIeditor是模式窗口.而且我无法记录或模拟单击浏览"按钮.播放总是以这样的错误结束

测试名称: CodedUITestMethod1
测试结果: 失败
结果消息:
测试方法CodedUITestProject8.CodedUITest1.CodedUITestMethod1引发异常:Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException:回放未能找到具有给定搜索属性的控件.其他详细信息:
技术名称: 'MSAA'
ControlType: 按钮"
名称: 浏览..."

使用下拉菜单编辑器时,错误类似.有时我无法将文本写入propertygrid.

我知道winforms是旧技术,但是我无法迁移到WPF.

好的,有一些方法可以使用UITypeEditors测试属性网格.我可以告诉播放浏览按钮在哪里继续播放吗?  

我可以设置一些测试项目,并确切显示出我的问题.

还是可以覆盖默认的PropertyGrid以使其与UICoded Test兼容?

谢谢您的帮助.


Hi there,

I am developing Map Drawing (GIS) application. I am using winform components Docking frame work from WeifenLuo some customs treeviews and mainly for user inputs default PropertyGrid with dozen UITypeEditors and TypeConverters. I am not care about user inputs cause I labeling my object with attributes and all work is doing by PropertyGrid like in VisualStudio. 

Now I am trying UICoded test that is in VisualStudio 2012. I am surprised that I am able record user action on my custom treeview and it works. But cause I am using PropertyGrid I have big problem with recording some action under Preperty Grid. 

For Example I have UIType Editors for setting some property. This UIeditor is modal window. And I have not able record or simulate click on Browse Button. Playback always ends with error like this

Test Name: CodedUITestMethod1
Test Outcome: Failed
Result Message:
Test method CodedUITestProject8.CodedUITest1.CodedUITestMethod1 threw exception: Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties. Additional Details: 
TechnologyName:  'MSAA'
ControlType:  'Button'
Name:  'Browse...'

With dropdown Editors the error is similar. Sometimes I am not able write text into propertygrid. 

I know that winforms is old technology but I am not able migrate to WPF.

Ok is there some way how to test property grid with UITypeEditors. Can I tell to playback where browse button is to continue playback?  

I can setup some test project and show exactly what is my problem. 

Or can I override default PropertyGrid to make it compatible with UICoded Test?

Thanks vary much for your help. 


推荐答案

IvanMjartan,

Hi IvanMjartan,

我怀疑您的控件在编码的UI记录和播放方面没有得到足够的支持.请参阅此博客中描述的四个UI编码支持级别:

I doubt that your controls don’t have enough support on Coded UI record and playback. Please see the four levels for coded UI support described in this blog: http://blogs.msdn.com/b/visualstudioalm/archive/2011/10/28/coded-ui-test-extension-for-3rd-party-controls-the-basics-explained.aspx

之后,您可以参考以下文档来为控件编写编码的UI测试:

After that, you can reference the following documents to write coded UI test for your controls:

启用已编码控件的UI测试

最好的问候


这篇关于编码的UI测试PropertyGrid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆