【QTP专题-优化】VBS脚本启动QTP并运行测试
使用vbs脚本启动QTP并运行测试,startQTP.vbs
'************************************************************************************************************************
'Description:
'
'This example opens a test, configures run options and settings,
'runs the test, and then checks the results of the test run.
'
'Assumptions:
'There is no unsaved test currently open in QuickTest.
'For more information, see the example for the Test.SaveAs method.
'When QuickTest opens, it loads the add-ins required for the test.
'For more information, see the example for the Test.GetAssociatedAddins method.
'************************************************************************************************************************ Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtTest 'As QuickTest.Test ' Declare a Test object variable
Dim qtResultsOpt 'As QuickTest.RunResultsOptions ' Declare a Run Results Options object variable Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Start QuickTest
qtApp.Visible = False ' Make the QuickTest application visible ' Set QuickTest run options
qtApp.Options.Run.ImageCaptureForTestResults = "OnError" qtApp.Options.Run.RunMode = "Fast"
qtApp.Options.Run.ViewResults = False qtApp.Open "D:\NewTest\Scripts\BeforeGlobal\Login", False ' Open the test in read-only mode ' set run settings for the test
Set qtTest = qtApp.Test
qtTest.Settings.Run.IterationMode = "oneIteration" ' Runs the test only once, using only the first row in the global Data Table
'qtTest.Settings.Run.IterationMode = "rngIterations" ' Run only iterations 2 to 4
'qtTest.Settings.Run.StartIteration = 2
'qtTest.Settings.Run.EndIteration = 4
qtTest.Settings.Run.OnError = "NextStep" ' Instruct QuickTest to perform next step when error occurs
qtApp.Test.Settings.Web.BrowserNavigationTimeout = 60000 ' Configure other Web settings Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions") ' Create the Run Results Options object
qtResultsOpt.ResultsLocation = "D:\NewTest\Res1" ' Set the results location qtTest.Run qtResultsOpt ' Run the test 'MsgBox qtTest.LastRunResults.Status ' Check the results of the test run
qtTest.Close ' Close the test
qtApp.Quit 'Close the QTP
Set qtResultsOpt = Nothing ' Release the Run Results Options object
Set qtTest = Nothing ' Release the Test object
Set qtApp = Nothing ' Release the Application object
更多详细信息可以参考QTP帮助文件AutomationObjectModel.chm中Application Object (若chm内容为空,可参考CHM文件使用问题)
【QTP专题-优化】VBS脚本启动QTP并运行测试的更多相关文章
- [vbs]脚本启动
Set ws = CreateObject("Wscript.Shell") ws.run "cmd.exe /c start tool.exe config_tence ...
- QTP关于AOM的Javascript启动方式
序 QTP的AOM模型想必大家都很熟悉了,平时常用的就是通过VBS脚本的方式编写启动程序(也是我现在用的方法).其实,还有很多其他的方式,如Java,C#,JS,这些语言都是通过调用QTObjectM ...
- 【QTP专题】05_参数化之Excel
QTP使用外部Excel实现参数化主要有以下两种方式 导入到DataTable中 Syntax:DataTable.ImportSheet(FileName, SheetSource, SheetDe ...
- VBS脚本完美实现开机延时启动
目录 概述 vbs内容示例: vbs示例语句分析 自定义vbs脚本 一些问题和解决方法 概述 系统开机时,顺带自动启动了不少驱动程序,使得电脑开机后鼠标要呆滞许久.为了加快windows的开机速度 ...
- Vbs脚本经典教材(转)
Vbs脚本经典教材(最全的资料还是MSDN) —为什么要使用Vbs? 在Windows中,学习计算机操作也许很简单,但是很多计算机工作是重复性劳动,例如你每周也许需要对一些计算机文件进行复制.粘贴.改 ...
- VBS脚本病毒特点及如何防范3(转)
5.Vbs病毒生产机的原理介绍 所谓病毒生产机就是指可以直接根据用户的选择产生病毒源代码的软件.在很多人看来这或许不可思议,其实对脚本病毒而言它的实现非常简单. 脚本语言是解释执行的.不需要编译,程序 ...
- VBS脚本随笔
1.定时运行程序与关闭程序的VBS处理方法: do set ws=createobject("wscript.shell") ws.run"你要运行的程序的路径(比如说d ...
- vbs脚本实现自动打字祝福&搞笑
脚本祝福礼物 概述 听说抖音上流行一种用代码做程序表白的东西,,,, 当然我也不是要表白,,,, 但是好像蛮有意思的,,,, 于是,又学了一下vbs脚本,做了几个很不错的祝福脚本,不懂代码的可以直接戳 ...
- vbs脚本实现qq定时发消息(初级)
vbs脚本实现QQ消息定时发送 目标 批处理又称为批处理脚本,强大的强大功能可以高效得实现很多功能,例如批量更改文件格式,批量进行文件读写,今天我们的目标是用vbs脚本编写可以发送qq消息的脚本,并利 ...
随机推荐
- HTML怎么让img 等比例缩放
在img标签里面只设置宽,不设置高,图片就会等比例缩放.
- UNITY IMGUI
这几天研究OPENGL时,想找一个UI库来用,发现了IMGUI,到网上搜索评估中,突然发现它似乎和UNITY有关系. UNITY文档中提到过IMGUI,不知道是不一个东西,仔细看了下文档,果然是.原文 ...
- linux运维笔记——curl
** 1.获取网站返回码 ** [root@Cacti ~]# curl -I www.qq.com HTTP/1.1 200 OK Server: squid/3.4.1 Date: Wed, 08 ...
- 遍历List集合时,删除数据的问题
一.问题描述 有时候,我们会遇到在遍历List集合的过程中删除数据的情况. 看着自己写的代码,感觉完全没有问题,但就是达不到预期的效果,这是为什么呢?下面我们来分析下 String str1 = ne ...
- Linux实战教学笔记26:http协议原理
目录 第二十六节 http协议原理 第1章 Web服务基础 1.1 http服务重要基础 1.2 HTTP协议 1.3 HTTP资源 1.4 网站流量度量术语 1.5 www服务软件介绍 1.6 本章 ...
- Python基础:面向对象基础(二) 继承
子类在继承的时候,在定义类时,小括号()中为父类的名字,父类的属性.方法,会被继承给子类,Python中允许多继承. 多继承 # 父类 Master class Master(object): def ...
- linux系统中的进程
一.fork 在类unix系统中,我们所执行的任何程序,都是由父进程(parent process)所产生出来的一个子进程(child process),子进程在结束后,将返回到父进程去.此一现象被称 ...
- fastdfs 清晰简介 有用
是什么? FastDFS是一个轻量级分布式文件系统. 能干嘛? 对文件进行管理,功能包括:文件存储.文件同步.文件访问(文件上传.文件下载)等. 在Linux上的安装连 ...
- catkin_make与gtest出现冲突的问题与解决
gtest是测试时调用的,把测试禁止掉试试 catkin_make --pkg pkgname -DCATKIN_ENABLE_TESTING=0
- code3731 寻找道路
将图反向,从终点spfa,把和终点没有联系的点找出来, 把它们和它们所连接的所有点删去(反向图) 然后再一遍spfa,输出最短路即可 代码: #include<iostream> #inc ...