- 浏览: 15862 次
最新评论
QTP的2种脚本调用方法是什么
- 博客分类:
- 技术杂绘
QTP的2种脚本调用方法是什么
2011年06月14日
我不知道你调用脚本是什么概念?在QTP中调用外部脚本?还是启动QTP脚本?
调用外部脚本,你可以采取VBS的程序去调用外部程序,或者你可以写COM接口,然后再QTP的中调用!
启动QTP脚本,你可以采取QTP的COM接口通过程序来调用
(3atesing有大量视频专门介绍QTP的各类实用模式的)
QTP的COM调用可参考:
Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Launch QuickTest
qtApp.Visible = True ' Set QuickTest to be visible
' Open a test and get the "Login" action's object repositories collection
qtApp.Open "C:\Tests\Test1", False, False ' Open a test
Set qtRepositories = qtApp.Test.Actions("Login").ObjectRepositories ' Get the object repositories collection object of the "Login" action
' Add MainApp.tsr if it's not already in the collection
If qtRepositories.Find("C:\MainApp.tsr") = -1 Then ' If the repository cannot be found in the collection
qtRepositories.Add "C:\MainApp.tsr", 1 ' Add the repository to the collection
End If
' If InnerWnd.tsr is moved down the list - place it back at position 1
If qtRepositories.Count > 1 And qtRepositories.Item(2) = "C:\InnerWnd.tsr" Then ' If there's more than one object repository and InnerWnd.tsr is in position 2
qtRepositories.MoveToPos 1, 2 ' Switch between the first two object repositories
End If
' If Debug.tsr is in the collection - remove it
lngPosition = qtRepositories.Find("C:\Debug.tsr") ' Try finding the Debug.tsr object repository
If lngPosition -1 Then ' If the object repository was found in the collection
qtRepositories.Remove lngPosition ' Remove it
End If
' Set the new object repository configuration as the default for all new actions
qtRepositories.SetAsDefault ' Set object repositories associated with the "Login" action as the default for all new actions
'Save the test and close QuickTest qtApp.Test.Save ' Save the test qtApp.Quit ' Quit QuickTest Set qtRepositories = Nothing ' Release the action's shared repositories collection Set qtApp = Nothing ' Release the Application object
发表评论
-
vbs学习笔记
2012-01-20 10:00 584vbs学习笔记 2010年06月20日 刚解了下fso, ... -
vbs脚本:MoveFolder
2012-01-20 09:59 668vbs脚本:MoveFolder 2010年08月08日 ... -
分享一个单机游戏的NSIS封装包脚本代码
2012-01-20 09:58 818分享一个单机游戏的NSIS封装包脚本代码 2011年05月1 ... -
在windows系统中配置关机和开机执行脚本
2012-01-20 09:57 829在windows系统中配置关机和开机执行脚本 2010年09 ... -
C#面试题集锦(你值得拥有!)
2012-01-19 15:01 1202C#面试题集锦(你值得拥 ... -
ASP.Net考试复习资料
2012-01-19 15:01 815ASP.Net考试复习资料 2011 ... -
javascript:history.go()和History.back()的区别
2012-01-19 15:01 977javascript:history.go()和History ... -
2011-6-25
2012-01-19 15:01 8752011-6-25 2011年06月25日 (71)下列 ... -
3DMAX 300问 (五)
2012-01-17 04:46 8023DMAX 300问 (五) 2011年04月23日 6 ... -
机能强劲 疑为N3DS主机用GPU规格透露?
2012-01-17 04:46 710机能强劲 疑为N3DS主机用GPU规格透露? 2010年06 ... -
perfHUD使用说明
2012-01-17 04:46 750perfHUD使用说明 2011年04月14日 perf ... -
6.14.10.6999 (20090814) - ATI Mobility Radeon HD 4500 Series
2012-01-17 04:46 8376.14.10.6999 (20090814) - ATI M ... -
★市售手机CPU型号性能点评★
2012-01-17 04:46 1430★市售手机CPU型号性能点评★ 2011年02月14日 ... -
Adsutil.vbs在脚本入侵中的妙用
2012-01-16 03:38 733Adsutil.vbs在脚本入侵中的妙用 2011年03月0 ... -
制作自动运行木马的vbs脚本
2012-01-16 03:38 1113制作自动运行木马的vbs ... -
vbs脚本文件执行提权技术技巧
2012-01-16 03:38 772vbs脚本文件执行提权技 ... -
vbs脚本实例
2012-01-16 03:38 664vbs脚本实例 2011年02月28日 rem 结束QQ ... -
利用VBS脚本让qq永远在线
2012-01-16 03:38 599利用VBS脚本让qq永远在线 2011年06月07日 让 ...
相关推荐
自动调用qtp运行相关脚本 自动调用qtp运行相关脚本
QTP 文件处理脚本函数 可以直接在QTP中调用,不用再编写了
使用vbscript脚本调用QTP并运行脚本。 配合http://download.csdn.net/detail/nor1127/5394005的代码文件,将文件解压到D/Tests即可使用。
QC连接QTP,配置QTP连接QC,利用QC远程执行QTP脚本,设置QTP定时运行脚本
从经验中学习很多东西,帮助零基础学者少走弯路,
检验TD是否安装成功,验证QTP安装成功,TD和QTP就连接起来,从TD调用QTP脚本
在自动化测试框架中经常设计分布式执行用例,调用不同计算机机上的qtp来执行,如何远程调用qtp有以下几个方法: 1.利用qc启动相应机器上qtp执行自动化测试用例 打开QC 打开test lab--> in the execution flow-->...
自动化录制脚本,主要用到函数调用,用计算器计算多数
介绍了如何在QC中调用QTP进行测试,可以在QC中执行一个单独的QTP脚本。
这是一个用qtp录制的脚本,每一个Action对应一个测试用例。 包括数据驱动,action调用,低级录制,场景恢复,功能键测试,检查点测试,正则表达式运用等。
2)QTP支持的脚本语言是VB,这对于测试人员来说,感觉要“舒服”得多(如相比SilkTest采用C语言)。VB毕竟是一种松散的、非严格的、普及面很广的语言。 3)QTP支持录制和回放的功能。录制产生的脚本,可以拿来作为...
2. 描述性编程2 15 3. 函数 17 3.1. QTP中几个截取字符串的函数 18 4. "+" "&"的区别 20 5. QTP场景恢复 21 6. QTP中测试环境的初始化 27 7. QTP将数据库中的数据导入到excel 29 8. 在QTP中将数据库的数据导入到...
一个关于QTP使用的简单实例,了解如何设置检查点,通过参数调用多个测试数据反复执行脚本。
QC管理QTP脚本参数及运用,QC中调用QTP脚本,并且设置参数,QC中制定测试计划,准备测试数据
40. 两种方法参数化link 101 41. WScript 102 42. QTP Plus 的应用 109 43. 一个万能的键盘模拟函数 110 44. XML参数化 115 45. Oracle QTP 115 46. 对象库的管理与合并 116 47. change sysdate 120 48. Import ...
2 QTP的录制 29 2.1 QTP的录制方法 29 2.2 QTP录制应先作录制计划 29 2.3 关于下拉菜单的更改 30 2.4 输入法对于回放的影响 32 2.5 如何修改系统时间 32 3 QTP的自定义操作 33 3.1 手工添加步骤 33 3.2 手工识别控件...
临近春节过年回家之际,现场又出问题,并发情况下游标报错。一封邮件让我周末不得不加班研究如何来模拟实际生产环境。大致需求是根据抄表段编号和... 对于这样的问题,开始我想挺好解决的,只要在脚本中加个循环控
qtp launch,调用vbs文件自动启动qtp运行测试脚本,远程call自动化测试
经过检查分析,主要是两方面原因导致,一是对象库的文件,默认生成得每个空的对象库文件为192K,这样一个空的QTP脚本文件就至少需要192K*2=384K的空间(Action0和Action1),如果分割的Action多的话,占用的空间就...
读Excel文件中的计算式,调用计算器实现自动计算 【Dim aslen,t , iRowCount, iLoop, numAdd,xlApp, xlFile, xlSheet Set xlApp = CreateObject ("Excel.Application") Set xlFile = xlApp.Workbooks.Open ("c:\a....