Mercury Quick Test Pro - 使用自定义网格进行测试
我们正在尝试创建一些引用供应商自定义网格的测试。 不幸的是,QTP 只将其识别为 WinObject,这是毫无用处的。 我们需要能够导航网格并更改单元格值,双击单元格(不使用 X,Y 坐标)等。
理想情况下,我们希望让 QTP 理解该对象是一个网格并将其视为一个网格。
任何帮助将不胜感激。
谢谢乔恩
We are trying to create some tests that reference an vendors custom grid. Unfortunatly QTP only recognises it as a WinObject which is quite useless. We need to be able to navigate the grid and change cell values, double click on a cell(without using X,Y co-ordinates) etc.
Ideally we want to get QTP to understand that this object is a grid and treat it as one.
Any help would be greatly appreciated.
Thanks
Jon
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
什么供应商?
我有一些建议:
您可以使用 .Object 属性以编程方式获取/设置网格属性。 .Object 提供对对象的底层本机属性和方法的访问,而不是 QTP 方法和属性。 您可以执行类似以下伪代码的操作来将焦点设置到单元格并更改值。 您的代码会根据供应商的实现而有所不同。 请查阅供应商的文档以了解您可以使用哪些方法和属性。
WinObject("mygrid").Object.CurRow = 1
WinObject("mygrid").Object.CurCol = 1
WinObject("mygrid").Object.Value = "my new value"
What vendor?
I have a few suggestions:
You may be able to programmatically get/set the grid properties using the .Object property. .Object provides access to the underlying native properties and methods of the object, as opposed to the QTP methods and properties. You could do something like the following pseudo-code to set focus to a cell and change the value. Your code would differ depending on the vendor implementation. Consult the vendor's documentation to find out what methods and properties you would be able to use.
WinObject("mygrid").Object.CurRow = 1
WinObject("mygrid").Object.CurCol = 1
WinObject("mygrid").Object.Value = "my new value"
如果所讨论的网格恰好是 Stingray 目标网格,QTP 有专门用于此的插件。
If the grid in question happens to be a Stingray Objective Grid, QTP has plugins specifically for that.
对于基础设施来说也是如此。 他们有一个用于 UltraWinGrid 等的 QTP 插件。
http://www.infragistics .com/dotnet/testadvantage.aspx#概述
Same thing for Infragistics. They have a plug-in for QTP for the UltraWinGrid etc.
http://www.infragistics.com/dotnet/testadvantage.aspx#Overview
将请求发送至支持中心是合理的做法。 如果他们收到大量请求 - 他们将增加对您的网格供应商的支持。
It is resonable to send the request to Support Center. If they will get a big number of requests - they will add support for your grid-vendor.
可能您忘记为您的网格供应商加载(安装)AddIn。
May be you forgot to load (install) AddIn for your grid-vendor.