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

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

问题描述

可能是一个捣蛋的故事 - QTP似乎浪费了我们的工作时间没有任何理由:



考虑这个脚本,具有一个完整的一个全局行的数据,其中26列名为A到Z填充任何值:

 打印开始
Services.StartTransactionSimpletest
设置G = DataTable.GetSheet(全局)
对于J = 1到26
对于I = 1到100
设置P = G.GetParameter(Chr(J + 64))
如果P.Value =嗨然后
结束如果
下一个
下一个
Services.EndTransactionSimpletest
打印已结束

在QTP 10下执行此操作会在我的blaster上执行 15.1秒。 (当然,动画运行是关闭的。)



现在我使用来自QTP的bin文件夹的mmdrv.exe来执行此操作,给出参数-usr全名,包括QTP测试的路径.usr文件。



需要 0.07秒



您好?这是一个215倍的性能提升,但功能相同。如何来?



我正在挖掘这里,因为我们使用QTP数据表做一些异国情调的东西,并在QTP下面临严重的性能问题。我相信跟踪了DataTable.GetSheet和DTSheet.GetParameter属性/方法的原因。



现在我看到,用于在LoadRunner方案中执行QTP测试的MMDRV没有性能损失,我不知道以下内容:




  • 访问xls文件是否有1:1的替代方案?

  • 不应该有人在Ex-Mercury / HP注意到,由于MMDRV.EXE演示,并且做了一些事情,QTP下的数据表访问效率很低?

  • 据我所见,所有其他QTP功能在MMDRV和QTP下具有相当的速度。有人承认吗
    *有没有人知道这个?



感谢任何回复,无论他们有多麻烦。 p>

* UPDATE * 使用QTP执行不可见需要1.54秒。这是一个10倍的改进,只是隐藏QTP如其中一个答案。

解决方案

我们与QTP具有相同的性能问题。经调查,我们在两个方面解决了问题。




  • 数据表(可怕的表现)

  • QTP是可见/不可见的



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



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

  Dim qtApp 
设置qtApp = CreateObject(QuickTest.Application)
qtApp。启动'开始QuickTest
如果qt​​App.Visible = False然后'使QuickTest应用程序不可见/可见
qtApp.Visible = True
Else
qtApp.Visible = False
结束如果

您是否愿意分享缓存DataTable的想法,因为我们正在考虑开发相同的机制并且有益于看到这样一个例子。



亲切的问候,
A chraf


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

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"

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

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.

That takes 0.07 seconds.

Hello? That's a 215-fold performance boost, but identical functionality. How comes?

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.

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:

  • 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 * 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.

解决方案

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

  • The Data Table (horrible performance)
  • QTP is visible/invisible

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

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

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.

Kind regards, Achraf

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

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