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
发表评论
-
让windows批处理脚本在后台运行
2012-01-20 01:32 1313让windows批处理脚本在后台运行 2010年12月24日 ... -
VBS学习笔记(2): Call造成的麻烦
2012-01-20 01:32 490VBS学习笔记(2): Call造成的麻烦 2011年02月 ... -
用vbs实现文本循环读取
2012-01-20 01:32 640用vbs实现文本循环读取 2010年06月16日 因为测 ... -
VBS启动Process
2012-01-20 01:32 635VBS启动Process 2010年06月09日 Run ... -
怎样从大便的性质判断小儿的消化功能?
2012-01-19 09:22 509怎样从大便的性质判断小儿的消化功能? 2011年11月25日 ... -
hehe
2012-01-19 09:22 500hehe 2010年06月01日 缁 -
关于Android的一些设计
2012-01-17 01:56 495关于Android的一些设计 2012年01月13日 ... -
Windows XP的小秘密 {7}
2012-01-17 01:56 472Windows XP的小秘密 {7} 201 ... -
3.1 MFC概述
2012-01-17 01:56 5463.1 MFC概述 2009年12月01 ... -
Platform Builder和Embedded visual C++简介
2012-01-17 01:56 432Platform Builder和Embedded vis ... -
搭建Windows下的Android开发环境
2012-01-17 01:56 605搭建Windows下的Android开发环境 2011年07 ... -
编程,乐趣何在?
2012-01-15 21:04 641编程,乐趣何在? 2011年12月20日 转载自:htt ... -
[评论]Flash,Silverlight,Win32:2011三大垂死平台
2012-01-15 21:04 538[评论]Flash,Silverlight,Win32:201 ... -
在CentOS上安装和配置 OpenNebula(1)
2012-01-15 21:04 701在CentOS上安装和配置 OpenNebula(1) 20 ... -
Three dying platforms: Flash, Silverlight, Win32
2012-01-15 21:04 622Three dying platforms: Flash, S ... -
Flash ActionScript3.0 库资源,很多非常有用的类库哦!!!
2012-01-15 21:03 458Flash ActionScript3.0 库资源,很多非常有 ...
相关推荐
自动调用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....