QTP 数据表操作*非常*慢(在 MMDRV 批处理执行器下好多了)? [英] QTP datatable operations *extremely* slow (much better under MMDRV batch executor)?

查看:19
本文介绍了QTP 数据表操作*非常*慢(在 MMDRV 批处理执行器下好多了)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能是一个轰动的故事——QTP似乎无缘无故地浪费了我们的工作时间:

Possibly a smashing story -- QTP seems to waste our worktime for no reason:

考虑这个脚本,有一个只有一个全局行的数据表,有 26 列名为A"到Z",填充了任何值:

Consider this script, having a datatable of exactly one global row with 26 columns named "A" to "Z" filled with any value:

Print "Started"
Services.StartTransaction "Simpletest"
Set G=DataTable.GetSheet ("Global")
For J=1 to 26   
    For I=1 to 100
        Set P=G.GetParameter (Chr (J+64))
        If P.Value = "Hi" Then
        End If
    Next
Next
Services.EndTransaction "Simpletest"
Print "Ended"

在 QTP 10 下执行此操作需要 15.1 秒在我的冲击波上.(当然,动画运行已关闭.)

Executing this under QTP 10 takes 15.1 seconds on my blaster. (Animated run is off, of course.)

现在我使用 QTP 的 bin 文件夹中的 mmdrv.exe 执行这个,给它参数-usr''",它是包含 QTP 测试 .usr 文件路径的全名.

Now I execute this using mmdrv.exe from QTP's bin folder, giving it the parameter "-usr ''" with being the full name including path to the QTP test .usr file.

这需要0.07 秒.

喂?这是 215 倍的性能提升,但功能相同.怎么来的?

我在这里挖掘,因为我们对 QTP 数据表做了一些奇特的事情,并且在 QTP 下面临严重的性能问题.我相信已经找到了 DataTable.GetSheet 和 DTSheet.GetParameter 属性/方法的原因.

I am digging around here since we do some exotic stuff with QTP data tables, and face serious performance problems under QTP. I believe to have tracked down the cause to the DataTable.GetSheet and DTSheet.GetParameter properties/methods.

现在我看到用于在 LoadRunner 场景中执行 QTP 测试的 MMDRV 没有这种性能损失,我想知道以下几点:

Now that I see that the MMDRV, which is for executing QTP tests from within LoadRunner scenarios, does not have that performance penalty, I wonder about the following:

  • 是否有 1:1 的替代方法来访问 xls 文件?
  • Ex-Mercury/HP 的某个人难道不应该注意到 QTP 下的数据表访问非常效率低下,正如 MMDRV.EXE 所展示的那样,并对此采取一些措施吗?
  • 据我所知,所有其他 QTP 功能在 MMDRV 和 QTP 下的速度相当.有人能承认吗?*还有其他人知道这件事吗?
  • Is there a 1:1 alternative for accessing xls files?
  • Shouldn't somebody at Ex-Mercury/HP notice that data table access under QTP is very inefficient, as MMDRV.EXE demonstrates, and do something about it?
  • As far as I can see, all other QTP functionality is of comparable speed under MMDRV and QTP. Can anybody acknowledge that? *Does anybody else know about this?

感谢您的任何回复,无论它们多么令人不安.

Thanks for any replies, no matter how disturbing they might be.

* UPDATE * 使用 QTP invisible 执行需要 1.54 秒.仅通过隐藏其中一个答案中概述的 QTP 就实现了 10 倍的改进.叹气.

* UPDATE * Executing with QTP invisible takes 1.54 seconds. That's a 10-fold improvement just by hiding QTP as outlined in one of the answers. Sigh.

推荐答案

我们在使用 QTP 时遇到了同样的性能问题.经过调查,我们在两个方面解决了问题.

We are having the same performance issues with QTP. After investigations, we cornered the problems in 2 areas.

  • 数据表(糟糕的表现)
  • QTP 可见/不可见

我们发现 QTP 在隐藏时运行速度快 5-6 倍

We found that QTP runs 5-6 times faster when it's hidden

我们在开发/调试时制作了一个小脚本来切换 QTP 的可见性(因为您总是可以强制 QTP 隐藏在远程代理设置中)'此脚本用于显示/隐藏 QTP 窗口'隐藏时 QTP 运行得更快

We made a small script to toggle QTP visibility while we develop/debug (because you can always force QTP to be hidden in the remote agent settings) 'This script is used to show/hide the QTP window 'QTP runs much faster when hidden

Dim qtApp
Set qtApp = CreateObject("QuickTest.Application")
qtApp.Launch            ' Start QuickTest
If qtApp.Visible = False Then  ' Make the QuickTest application invisible/visible
    qtApp.Visible = True
Else
    qtApp.Visible = False
End If

您能否分享一下缓存 DataTable 的想法,因为我们正在考虑开发相同的机制,并且看到这样的示例会有所帮助.

Would you kindly share the idea of caching the DataTable as we are thinking to develop the same mechanism and would benefit to see such an example.

亲切的问候,阿什拉夫

这篇关于QTP 数据表操作*非常*慢(在 MMDRV 批处理执行器下好多了)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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