Micro Focus QTP (UFT) Forums
JENKINS to QTP Integration Remotely WMI/VBscript help need - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: JENKINS to QTP Integration Remotely WMI/VBscript help need (/Thread-JENKINS-to-QTP-Integration-Remotely-WMI-VBscript-help-need)



JENKINS to QTP Integration Remotely WMI/VBscript help need - raju999 - 01-27-2013

Hi I need help to connect remote machine and execute vbscript(test scripts) by opening QTP application.


By using VB Script I have connect one workstaiton to another workstation and I have to open QTP application by uisng QTP application I have to run test script.


Can you please help me .. Because I have no much knowledge about this script..

Code:
strUser = "K003277"


strDomain = "PNKUKDEV"


strComputer ="DV01123"


strPassword = "Pork2013"


Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")


Set objWMIService = objSWbemLocator.ConnectServer(strComputer, _


"root\CIMV2", _


strUser, _


strPassword, _


"MS_409", _


"NTLMDomain:" + strDomain)


Dim QTApp = objWMIService.Create("QTPro.exe", null, null, intQTPID)
'set TApp = GetObject(QTApp)
QtApp.Open "C:\Temp\simple_test.vbs", True '


Set qtTest = qtApp.Test


qtTest.Run


Set colProcesses = objWMIService.ExecNotificationQuery _
    ("Select * From __InstanceDeletionEvent " _
            & "Within 1 Where TargetInstance ISA 'Win32_Process'")


Set colProcesses = objWMIService.ExecQuery _
    ("Select * from Win32_Process Where ProcessID = " & intQTPID)


For Each objProcess in colProcesses
    objProcess.Terminate()
Next