使用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并运行测试的更多相关文章

  1. [vbs]脚本启动

    Set ws = CreateObject("Wscript.Shell") ws.run "cmd.exe /c start tool.exe config_tence ...

  2. QTP关于AOM的Javascript启动方式

    序 QTP的AOM模型想必大家都很熟悉了,平时常用的就是通过VBS脚本的方式编写启动程序(也是我现在用的方法).其实,还有很多其他的方式,如Java,C#,JS,这些语言都是通过调用QTObjectM ...

  3. 【QTP专题】05_参数化之Excel

    QTP使用外部Excel实现参数化主要有以下两种方式 导入到DataTable中 Syntax:DataTable.ImportSheet(FileName, SheetSource, SheetDe ...

  4. VBS脚本完美实现开机延时启动

    目录 概述 vbs内容示例: vbs示例语句分析 自定义vbs脚本 一些问题和解决方法   概述 系统开机时,顺带自动启动了不少驱动程序,使得电脑开机后鼠标要呆滞许久.为了加快windows的开机速度 ...

  5. Vbs脚本经典教材(转)

    Vbs脚本经典教材(最全的资料还是MSDN) —为什么要使用Vbs? 在Windows中,学习计算机操作也许很简单,但是很多计算机工作是重复性劳动,例如你每周也许需要对一些计算机文件进行复制.粘贴.改 ...

  6. VBS脚本病毒特点及如何防范3(转)

    5.Vbs病毒生产机的原理介绍 所谓病毒生产机就是指可以直接根据用户的选择产生病毒源代码的软件.在很多人看来这或许不可思议,其实对脚本病毒而言它的实现非常简单. 脚本语言是解释执行的.不需要编译,程序 ...

  7. VBS脚本随笔

    1.定时运行程序与关闭程序的VBS处理方法: do set ws=createobject("wscript.shell") ws.run"你要运行的程序的路径(比如说d ...

  8. vbs脚本实现自动打字祝福&搞笑

    脚本祝福礼物 概述 听说抖音上流行一种用代码做程序表白的东西,,,, 当然我也不是要表白,,,, 但是好像蛮有意思的,,,, 于是,又学了一下vbs脚本,做了几个很不错的祝福脚本,不懂代码的可以直接戳 ...

  9. vbs脚本实现qq定时发消息(初级)

    vbs脚本实现QQ消息定时发送 目标 批处理又称为批处理脚本,强大的强大功能可以高效得实现很多功能,例如批量更改文件格式,批量进行文件读写,今天我们的目标是用vbs脚本编写可以发送qq消息的脚本,并利 ...

随机推荐

  1. <转>Linux环境进程间通信(五): 共享内存(上)

    http://www.ibm.com/developerworks/cn/linux/l-ipc/part5/index1.html 采用共享内存通信的一个显而易见的好处是效率高,因为进程可以直接读写 ...

  2. ADB Not Responding - Android Studio

    问题描述: 最近安装了Android Studio v1.0,运行的时候老是这个错误 解决方案: 网上有人说是已经有adb的进程在运行,可是打开任务管理器,找不到对应的adb 进程. 无奈之下,想到a ...

  3. C#登陆界面学习编写 2018.08.03

    简单的登陆界面的编写,在编写如下界面时,设置错误次数上限需要用到静态变量 public static int count;//计算错误次数(为静态变量) 可以防止点击登陆后次数被清空,在登陆后打开新的 ...

  4. zoj1037-Gridland

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=37 Gridland Time Limit: 2 Seconds      Me ...

  5. Unity 导出NavMesh (可行走区域判定) 数据给服务器使用

    cp790621656 博客专家 Unity 导出NavMesh (可行走区域判定) 数据给服务器使用 发表于2016/9/26 18:15:11  1089人阅读 分类: Unity MMO 这个 ...

  6. svm原理及opencv

    转自http://www.cnblogs.com/justany/archive/2012/11/23/2784125.html

  7. 修改字符集AL32UTF8修改为ZHS16GBK详解

    登陆sqlplus,在命令行输入 sqlplus sys/sys as sysdba;//登陆sqlplus SQL>SHUTDOWN IMMEDIATE; SQL>STARTUP MOU ...

  8. ConcurrentHashMap的实现原理与使用

    一.适应ConcurrentHashMap的原因 HashMap存在线程不安全的问题,HashTable效率十分低下,因此,ConcurrentHashMap有了合适的登场机会. (1)HashTab ...

  9. jquery的get()方法

    通过检索匹配jQuery对象得到对应的DOM元素. .get( [index ] ) index 类型: Integer 从0开始计数,用来确定获取哪个元素. .get() 方法允许我们直接访问jQu ...

  10. Mysql中自定义函数编程

    1.语法 1.1 新建函数 Create function function_name(参数列表) returns 返回值类型 函数体 (1)函数名,应该合法的标识符,并且不应该与已有的关键字冲突. ...