测试设置的生成的自动脚本示例

相关项: GUI 测试

下面的 UFT One 自动脚本显示了使用“测试设置”对话框中的生成脚本按钮生成的示例脚本。生成的脚本加载了 Web 和 Java 插件。

Dim App 'As Application
Set App = CreateObject("QuickTest.Application")
App.Launch
App.Visible = True
App.Test.Settings.Launchers("Java").Active = False
App.Test.Settings.Launchers("Java").CommandLine = ""
App.Test.Settings.Launchers("Java").WorkingDirectory = ""
App.Test.Settings.Launchers("Web").Active = False
App.Test.Settings.Launchers("Web").Browser = "IE"
App.Test.Settings.Launchers("Web").Address = "https://advantageonlineshopping.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 = True