qtp integration with jenkins

qtp integration with jenkins

Create a “.vbs” file as below and save the file as “AOM.vbs” in C:\QTP\VBS folder.

 In Jenkins create Job, Select ‘Execute Windows Batch Command’ in Build Step. Enter below command.

 and then use that in Jenkins.

Note: To learn how to create a Jenkins job or how to start jenkins – please refer  create a Jenkins job and Run Jenkins locally

 Below code is the “AOM.vbs” which is called by Jenkins Job.

Call QTP()

Public function QTP()

‘Create Quick test pro(QTP/UFT) object

Set objQTP = CreateObject(“QuickTest.Application”)

objQTP.Launch

objQTP.Visible = True

‘to open QTP Test

objQTP.Open “Test file path “, True

Set objResults= CreateObject(“QuickTest.RunResultsOptions”)

objResults.ResultsLocation = “Result path of qtp”  ‘Set the results location

‘to run qtp script results

objQTP.Test.Run objResults

‘to close QTP

objQTP.Test.Close

objQTP.Quit

End function