我是QTP的新手。我想从Jenkins触发QTP。我已经使用QTP自动化了一个网站,然后通过关注file-> settings获得了vbscript。现在我想让jenkins触发vbscripts,这样我就可以查看自动化过程了。我来了要知道我需要从Jenkins的Build选项中出现的Windows批处理文件中调用vbscript。我在我的windows批处理文件中编写了一个命令cscript "\\path to my vbscript"
。但是我无法运行vbscript。 / p>
我发现了一个类似的问题(QTP to Jenkins integration help need CI),但由于我对QTP和Jenkins的无知,我无法得到结果。
这是我的vbscript
`Dim App 'As Application
Set App = CreateObject("QuickTest.Application")
App.Launch
App.Visible = True
App.Test.Settings.Launchers("Flex").Active = False
App.Test.Settings.Launchers("Flex").Applications.RemoveAll
App.Test.Settings.Launchers("Java").Active = False
App.Test.Settings.Launchers("Java").CommandLine = ""
App.Test.Settings.Launchers("Java").WorkingDirectory = ""
App.Test.Settings.Launchers("Siebel").Active = False
App.Test.Settings.Launchers("Siebel").Version = "77"
App.Test.Settings.Launchers("Siebel").Address = ""
App.Test.Settings.Launchers("Siebel").AutoLogin = True
App.Test.Settings.Launchers("Siebel").User = ""
App.Test.Settings.Launchers("Siebel").Password = ""
App.Test.Settings.Launchers("Siebel").LogoutOnExit = True
App.Test.Settings.Launchers("Siebel").CloseOnExit = True
App.Test.Settings.Launchers("Siebel").SiebAutomationRequestTimeout = 120
App.Test.Settings.Launchers("Siebel").SiebAutomationAccessCode = ""
App.Test.Settings.Launchers("Web").Active = True
App.Test.Settings.Launchers("Web").Browser = "IE"
App.Test.Settings.Launchers("Web").Address = "https://orbit.sonata-software.com"
App.Test.Settings.Launchers("Web").CloseOnExit = True
App.Test.Settings.Launchers("Windows Applications").Active = True
App.Test.Settings.Launchers("Windows Applications").Applications.RemoveAll
App.Test.Settings.Launchers("Windows Applications").RecordOnQTDescendants = True
App.Test.Settings.Launchers("Windows Applications").RecordOnExplorerDescendants = False
App.Test.Settings.Launchers("Windows Applications").RecordOnSpecifiedApplications = True
App.Test.Settings.Run.IterationMode = "rngAll"
App.Test.Settings.Run.StartIteration = 1
App.Test.Settings.Run.EndIteration = 1
App.Test.Settings.Run.ObjectSyncTimeOut = 20000
App.Test.Settings.Run.DisableSmartIdentification = False
App.Test.Settings.Run.OnError = "Dialog"
App.Test.Settings.Resources.DataTablePath = "<Default>"
App.Test.Settings.Resources.Libraries.RemoveAll
App.Test.Settings.Web.BrowserNavigationTimeout = 60000
App.Test.Settings.Web.ActiveScreenAccess.UserName = ""
App.Test.Settings.Web.ActiveScreenAccess.Password = ""
App.Test.Settings.Java.EditSet.KeyPressed = True
App.Test.Settings.Java.EditSet.KeyTyped = True
App.Test.Settings.Java.EditSet.KeyReleased = True
App.Test.Settings.Java.EditSet.InputMethod = False
App.Test.Settings.Java.EditSet.FocusLost = False
App.Test.Settings.Java.EditSet.JavaAPI = False
App.Test.Settings.Java.EditSet.JavaAPICharactersToExclude = "\t\n\r"
App.Test.Settings.Java.DeviceReplay.Click = False
App.Test.Settings.Java.DeviceReplay.DoubleClick = False
App.Test.Settings.Java.DeviceReplay.Type = False
App.Test.Settings.Java.DeviceReplay.DragDrop = False
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' System Local Monitoring settings
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
App.Test.Settings.LocalSystemMonitor.Enable = false
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Log Tracking settings
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
With App.Test.Settings.LogTracking
.IncludeInResults = False
.Port = 18081
.IP = "127.0.0.1"
.MinTriggerLevel = "ERROR"
.EnableAutoConfig = False
.RecoverConfigAfterRun = False
.ConfigFile = ""
.MinConfigLevel = "WARN"
End With`
我无法执行我的vbscript。请提出一些如何执行它的想法
答案 0 :(得分:3)
详细解答,
http://www.testautomationguru.com/executing-qtpuft-scripts-using-jenkins/
然后你需要一个VBScript文件,该文件使用QTP / UFT自动化对象模型以编程方式调用QTP / UFT(这里就像这样)。确保您的vbscript正常工作。
Set QTP = CreateObject("QuickTest.Application")
QTP.Launch
QTP.Visible = TRUE
QTP.Open "path of the qtp test", TRUE
QTP.Test.Run NOTHING, TRUE
QTP.Test.Close
QTP.Quit
在詹金斯,创造一份工作。选择“执行Windows批处理命令”&#39;在构建步骤中。输入以下命令。您不需要BAT文件。
CScript "path of the vbscript file"