1.利用qc启动相应机器上qtp执行自动化测试用例 打开QC 打开test lab--> in the execution flow-->设置
2.利用wmi对象远程启动远程进程
脚本代码例子:
strComputer = "."
strCommand = "QPro.exe"
Const INTERVAL = "n"
Const MINUTES = 1
Set ōbjWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set ōbjScheduledJob = objWMIService.Get("Win32_ScheduledJob")
Set ōbjSWbemDateTime = CreateObject("Wbemscrīpting.SWbemDateTime")
objSWbemDateTime.SetVarDate(DateAdd(INTERVAL, MINUTES, Now()))
errReturn = objScheduledJob.Create(strCommand, objSWbemDateTime.Value, False, 0, 0, True, intJobID)
If errReturn = 0 Then
Wscrīpt.Echo "notepad.exe was started with a process ID: " & intJobID
Else
Wscrīpt.Echo "notepad.exe could not be started due to error: "&errReturn
End If
3.利用lr controller远程启动qtp自动化测试脚本
打开controller,然后加载qtp脚本,设置load generator