UFT Run-time Engine
UFT’s runtime engine allows you to run the API and GUI tests including BPT Tests without installing the complete UFT IDE. Machines with runtime engine can be used as the execution only machines. Even Run results Viewer is not required to be installed on the machine.
Run time engine will be beneficial for the any kind of executions which where you are trying to run your tests from an external source or on an execution only machine, like one used by the developers for building the new code and executing the Unit tests, or when you use Jenkins or ALM for the executions of the tests.
Run-time engine is one of the option within the UFT setup window during installation
You can choose to only install the runtime engine and skip the installation of the UFT GUI. This will only allow you to execute the scripts on a machine.
How to change settings for the runtime engine
Goto Start->All programs->HP Software->HP Unified Functional Testing->Tools->Runtime Engine
What you can configure in settings
You can change the following settings
- Run Options
- Run Results Export Options
- Remote Connection options
- Web and Windows Application options
Installing License for running the tests using runtime Engine
There are two ways for installing the License for Runtime Engine
- Using GUI : Goto Start->All programs->HP Software->HP Unified Functional Testing->Tools->License Installation wizard
- Using Command Line
“<UFT installation directory>\bin\HP.UFT.LicenseInstall.exe” seat “<license key string>”/seat “<path to the license key file”
“<UFT installation directory>\bin\HP.UFT.LicenseInstall.exe” concurrent <license ID> <license version> <server name/address> [<redundant server name/address>] [/force]
Executing tests using runtime engine
Basically UFT runtime engine will allow you to execute the scripts using the UFT’s AOM. So, you can use the below scripts to execute the tests
Set OUFT = CreateObject(“QuickTest.Application“) ‘ Create the application object
OUFT.Visible = False
OUFT.Launch ‘Start UFT
OUFT.Test.Run Nothing, true, False
Importing and exporting runtime engine settings
Runtime engine settings can be exported and imported from one machine to another machine. its same as exporting ad applying UFT settings using the vbs file.
On Error Resume Next Dim App Set App = CreateObject("QuickTest.Application") App.Visible = False If App.Launched Then WScript.Echo("The UFT application is still running. Close it before changing your settings.") WScript.Quit End If App.SetActiveAddins Array("Web"), errorDescription App.Launch App.Options.TextRecognitionOrder = "OCROnly" App.Options.TextRecognitionBlockType = "Multiple" App.Options.TextRecognitionLanguages = "English" App.Options.Run.ViewResults = True App.Options.Run.AllowOtherHpProductsRun = True App.Options.Run.RunMode = "Normal" App.Options.Run.ImageCaptureForTestResults = "OnError" App.Options.Run.MovieCaptureForTestResults = "Never" App.Options.Run.MovieSegmentSize = 2048 App.Options.Run.SaveMovieOfEntireRun = False App.Options.Run.StepExecutionDelay = 0 App.Options.Run.ReportFormat = "HTML" App.Options.Run.EnableRdp = False App.Options.Run.RdpUserName = "" App.Options.Run.RdpPasswordEncrypted = "0SWoxfcgI8AwDTlJKrk8aA==" App.Options.Run.AutoExportReportConfig.AutoExportResults = False App.Options.Run.AutoExportReportConfig.StepDetailsReport = True App.Options.Run.AutoExportReportConfig.DataTableReport = True App.Options.Run.AutoExportReportConfig.LogTrackingReport = True App.Options.Run.AutoExportReportConfig.ScreenRecorderReport = True App.Options.Run.AutoExportReportConfig.SystemMonitorReport = True App.Options.Run.AutoExportReportConfig.ExportLocation = "" App.Options.Run.AutoExportReportConfig.UserDefinedXSL = "" App.Options.Run.AutoExportReportConfig.StepDetailsReportType = "HTML" App.Options.Run.AutoExportReportConfig.StepDetailsReportFormat = "Short" App.Options.Run.AutoExportReportConfig.ExportForFailedRunsOnly = True App.Options.WindowsApps.ForceEnumChildWindows = False App.Options.WindowsApps.ClickEditBeforeSetText = False App.Options.WindowsApps.UseKeyboardToPerformSet = False App.Options.Web.BrowserCleanup = False App.Options.Web.RunOnlyClick = False App.Options.Web.RunUsingSourceIndex = False App.Options.Web.RunMouseByEvents = True App.Folders.RemoveAll If Err Then WScript.Echo("Error: " & CStr(Err.Number) & " " & Err.Description & vbCrLf & "Source: " & Err.Source) End If App.Quit
Now if you observe carefully, HP has done some changes to the above code. There is a condition for error handling. If you are running this script from jenkins or some other source, it might not run properly, because of the Wscipt.Echo function. You should comment it, or make sure that you have it handled in some way.
You can utilize runtime engine for running the tests from
- Automation object model
- Jenkins Plugin
- Test Batch Runner
- Silent Test Runner
Sumeet Singh Kushwah