Mercury Quick Test Pro 和虚拟机:可以在一台客户端计算机上运行,​​但不能在另一台客户端计算机上运行

发布于 2024-07-05 17:30:01 字数 498 浏览 3 评论 0原文

我有一台安装了 Mercury Quick Test Professional 9.2 的虚拟机 (VMware)。 我有一个用于测试应用程序的脚本,该脚本是使用 Infragistics 库用 VB.NET 编写的。

如果我使用笔记本电脑(使用远程桌面)访问此虚拟机,则一切正常,脚本完成时没有问题。 我的笔记本电脑运行 XP,带有 Windows Classic 主题。

如果我使用另一台计算机(使用远程桌面)访问此虚拟机,脚本启动正常,但中途停止,QTP 没有任何错误消息,什么也没有。 这台机器运行 XP,带有 Windows Classic 主题。

两种设置之间的一个区别是屏幕尺寸,笔记本电脑为 1920x1280,其他机器为 1280x1024。

脚本停止的步骤涉及选中 UltraWinGrid 中的复选框。 在这两种情况下,复选框本身都会显示在屏幕上。

有没有人以前遇到过这个问题,或者知道为什么两台机器之间的行为不同?

谢谢。

I have a virtual machine (VMware) with Mercury Quick Test Professional 9.2 installed. I have a script to test an application, written in VB.NET using the Infragistics library.

If I access this virtual machine using my laptop (using Remote Desktop), everything works fine, the script completes without a problem. My laptop runs XP, with Windows Classic theme.

If I access this virtual machine using another machine (using Remote Desktop), the script starts fine, but stops halfway through, without no error message from QTP, nothing. This machine runs XP, with Windows Classic theme.

One difference between the two setups is the size of the screen, the laptop is 1920x1280, other machine 1280x1024.

The step where the script stops involves checking a checkbox within an UltraWinGrid. The checkbox itself is displayed, is on the screen in both cases.

Has anyone had this problem before, or have any idea why the behaviour is different between the two machines?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(5

红焚 2024-07-12 17:30:01

有几件事:

您应该能够轻松地在虚拟机上进行调试 - 只需等待它停止,进入您的对象存储库,看看它是否可以识别该对象。 如果不是,则使用对象间谍来找出操作系统之间哪些属性不同。 如果存在差异,那么您始终可以将该属性设置为正则表达式并让它检查两种可能性。

假设这不是问题,如果远程窗口关闭或最小化,我们在使用带有 QTP 的远程桌面时会遇到问题。 对于我们来说,这是一个当 RDP 窗口不可见时剪贴板无法更改的问题,但以这种方式使用 QTP 时可能会出现其他意外。

A few things:

You should be able to debug on the VM easily - just wait for it to stop, go into your object repository, and see if it can identify the object. If no then use object spy to figure out what properties are different between the OSes. If there is a difference then you can always set that property to a regular expression and have it check for both possibilities.

Assuming that isn't the issue we've run into problems using remote desktop with QTP if the Remote window is closed or minimized. For us, it was an issue where the clipboard can not be changed when an RDP window isn't visible, but there could be other surprises when using QTP that way.

苯莒 2024-07-12 17:30:01

QTP 不使用屏幕坐标,除非作为最后的手段,如果对象被标识为高级对象(在本例中为 SwfTable),那么您应该没问题,但是如果 QTP 不这样做无法识别它回退到 WinObject 和屏幕坐标的对象。

如果您使用 Infragistics,那么您应该知道他们通过 TestAdvantage 扩展了 QTP 的支持 产品可能会解决您的问题。


编辑:
@MatthieuF 说道:

事实上,我们使用QTP的Infragistics插件,仍然有问题

您能给我一个失败的线路示例吗?

QTP does not use screen coordinates except as a last resort, if the objects are identified as high level objects (SwfTable in this case) you should be OK, if however QTP doesn't recognise the object it falls back to WinObject and screen coordinates.

If you're using Infragistics then you should know that they extend QTP's support with their TestAdvantage product which will probably solve your issue.


Edit:
@MatthieuF said:

In fact, we use the Infragistics plugin for QTP, and we still have the problem

Can you give me an example of a line that fails?

行至春深 2024-07-12 17:30:01

澄清点:您提到 QTP 停止时没有错误消息。 这是否也意味着测试结果日志文件也没有错误消息? 如果日志有任何信息,可能有助于诊断问题。 您能分享一下脚本失败时的代码行吗?

此外,远程桌面将调整远程计算机上的桌面大小。 尽管 QTP 脚本本质上不是基于坐标的,但各个语句可以是相对于对象而言基于坐标的。 该决议可能是这方面的一个问题。 例如,假设您在更高分辨率的机器上记录了像 Button.Click(5, 150) 这样的行。 但是,如果您尝试在较低分辨率的计算机上播放它,并且 150 超出了较低分辨率上的对象范围,则可能会导致问题。

Point of clarification: You mentioned that QTP stops with no error message. Does that also mean that the test results log file also has no error message? If the log has any information, that may be helpful in diagnosing the problem. Could you share the lines of code at the point where the script fails?

Also, remote desktop will resize the desktop on the remote machine. Although QTP scripts are not inherently coordinate based, individual statements can be coordinate-based relative to an object. The resolution could be an issue in that regard. For example, imagine you had a line like Button.Click(5, 150) recorded on a higher resolution machine. But if you attempted to play it back on a lower resolution machine, and the 150 is out of bounds of the object on the lower resolution, it could cause an issue.

鹊巢 2024-07-12 17:30:01

如果您没有使用专家模式,和/或允许 QTP 完成大部分工作来创建存储库对象,那么它是通过像素引用所有内容。

我手动创建所有存储库对象,查看源代码(在自动化 Web 应用程序测试的情况下)并在需要时使用对象间谍来获取帮助。 我强调不要将任何定位信息作为我的对象定义的一部分,这正是您遇到的原因。

对于我的网络应用程序中与 Windows 交互的部分(打开要上传的文件等),对象间谍对于创建用于创建存储库对象的唯一标识符所需的试验和错误至关重要。 但这是可以完成的。

Ex1:文件浏览对话框
text =“选择文件”
nativeclass = #32770(显然是一些用于文件打开对话框的 Windows VooDoo?)

Ex2:浏览对话框中的文件名文本框:
nativeclass =“编辑”
附加文本“文件和名称:”(更多 Windows VooDoo?如果没有“&”,它对我不起作用)

Ex3:对话框中的打开按钮:
text =“&打开”
对象类=“按钮”

祝你好运!

If you are not using Expert Mode, and / or are allowing QTP to do most of the work to create your repository objects, then yes it is referencing everything by pixels.

I create all of my repository objects by hand, viewing the source (in the case of automated web-application testing) and using the Object Spy for assistance where needed. I make a point to not have any positioning information as part of my object definition, for the very reason you are running in to.

For the parts of my web-app that interacted with Windows (opening a file to upload, etc.) the Object Spy was essential for the trial and error necessary to create a unique identifier for creating the repository object. But it can be done.

Ex1: File Browse Dialog
text = "Choose file"
nativeclass = #32770 (apparently some Windows VooDoo for a file open dialog?)

Ex2: Filename textbox in Browse dialog:
nativeclass = "Edit"
attached text "File &name:" (more Windows VooDoo? It woudn't work for me without the "&")

Ex3: Open Button in the dialog:
text = "&Open"
object class = "Button"

Good Luck!

甜尕妞 2024-07-12 17:30:01

好的。 我已经找到问题了。 事实上,脚本默默地失败了,因为这是编写脚本的人告诉它要做的事情。 它无法验证屏幕外的内容,因此脚本失败。

问题在于 QTP 对“离屏”的定义。 我的笔记本电脑上连接了两个屏幕,一个是笔记本电脑本身的屏幕 (1920x1200),另一个屏幕是 (1280x1024)。 我使用远程桌面连接到 QTP 虚拟机,它使用笔记本电脑屏幕的设置。 这意味着当我启动 QTP 脚本并将其移动到另一个屏幕时,它不适合,因此屏幕不再最大化,并且该对象部分超出屏幕,因此无法找到。

修复方法很简单:在远程桌面中,使用“显示”选项卡,并将屏幕尺寸设置为 1280x1024,QTP 就不再有任何问题。

瞧。

OK. I've found the problem. In fact, the script was failing silently because that's what the person who wrote the script told it to do. It couldn't validate something which was off screen, so the script failed.

The problem was the QTP definition of 'off screen'. I have two screens attached to my laptop, the screen for the laptop itself (1920x1200) and another screen (1280x1024). I connect to the VM for QTP using remote desktop, and it uses the settings of the screen for the laptop. This means that when I launch my QTP script, and move it to the other screen, it doesn't fit, so the screen is no longer maximized, and the object is partially off screen, so can't be found.

The fix is simple: in the Remote Desktop, use the Display tab, and set the size of the screen to a size to 1280x1024, and QTP doesn't have any more problems.

Voilà.

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