Mercury Quick Test Pro - 使用自定义网格进行测试

发布于 2024-07-06 11:48:10 字数 199 浏览 6 评论 0原文

我们正在尝试创建一些引用供应商自定义网格的测试。 不幸的是,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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

作业与我同在 2024-07-13 11:48:10

什么供应商?

我有一些建议:

  1. 使用击键来导航网格,而不是单击鼠标。 Ctrl-Home 将焦点设置到左上角的单元格,然后使用上、下、左、右移动。 使用 Enter 按键来模拟双击。 通常,您可以使用 Ctrl-A、Ctrl-C 将网格内容复制到系统剪贴板,并使用剪贴板 API 检索数据。
  2. 您可以使用 .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:

  1. Use key strokes to navigate the grid, rather than mouse clicks. Ctrl-Home to set focus to the top-left cell, then use up, down, left, right to move around. Use Enter keystroke to simulate double clicking. Often you can use Ctrl-A, Ctrl-C to copy the contents of the grid to the system clipboard, and use the clipboard API to retrieve the data.
  2. 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"

一杯敬自由 2024-07-13 11:48:10

如果所讨论的网格恰好是 Stingray 目标网格,QTP 有专门用于此的插件。

If the grid in question happens to be a Stingray Objective Grid, QTP has plugins specifically for that.

仙气飘飘 2024-07-13 11:48:10

对于基础设施来说也是如此。 他们有一个用于 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

海未深 2024-07-13 11:48:10

将请求发送至支持中心是合理的做法。 如果他们收到大量请求 - 他们将增加对您的网格供应商的支持。

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.

絕版丫頭 2024-07-13 11:48:10

可能您忘记为您的网格供应商加载(安装)AddIn。

May be you forgot to load (install) AddIn for your grid-vendor.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文