【发布时间】:2015-09-28 05:52:28
【问题描述】:
我需要使用 vbscipt 启动 qtp.exe 应用程序,但我不明白如何单击某个按钮以及如何使用 vbscript 打开特定的测试文件。
请给我一些提示或想法。
【问题讨论】:
标签: vbscript automated-tests qtp
我需要使用 vbscipt 启动 qtp.exe 应用程序,但我不明白如何单击某个按钮以及如何使用 vbscript 打开特定的测试文件。
请给我一些提示或想法。
【问题讨论】:
标签: vbscript automated-tests qtp
您可以通过创建 QTP 的 COM 对象轻松完成。
Dim QTPObj,QTPTest
Set QTPObj=CreateObject("QuickTest.Application")
'Check if the application is not already Launched
If Not QTPObj.Launched then
QTPObj.Launch
end if
QTPObj.Visible=True
QTPObj.Open "D:\MyQTPTests\Test1001 1001" 'name of the start up script
Set QTPTest=QTPObj.Test
QTPTest.Run 'Run the Test
QTPTest.Close 'Close the Test
QTPObj.Quit 'Quit the QTP Application
【讨论】: