UFT/QTP

UFT – Azure DevOps Integration

The Microsoft CI system Azure DevOps Server can trigger tests using UFT from the local file system, from ALM, or from the ALM Test Lab module.

Prerequisite:

1) A Machine with a UFT One Testing Automation Software Installed.

2) An Azure DevOps accounts.

Setup Self-hosted Windows Agent:

  1. Login to Azure DevOps Account and click the “User Settings” then Click “Personal access tokens”.

In the Create a new personal access token setting, click Show all scopes as shown in the screenshot below to show the settings that the self-hosted build agent requires. Create a new token with “Agent Pools” scope (check box Read & Manage checked)

Save the Token at Safe Place.

2. Go to your Organization Settings and to Agent pool section-> Default pool.

Click Organization Settings

Click “Agent Pools” -> Default

Click on New Agent and download the agent.

Copy the Agent to UFT One VM and keep it under download folder. Follow the steps to configure your VM as a Self-Hosted Agent. Open up a PowerShell terminal as an administrator and run the first block of code highlighted in the screenshot above to create a directory called agent and to extract the the agent to the new directory.

Run the second block of code in the PowerShell terminal that is highlighted in the screenshot above to start the configuration of the agent.

Enter the server url – https://dev.azure.com/<Azure_DevOps_Organisation> for example – https://dev.azure.com/QADevCode

Press Enter for PAT Authentication Type

Enter the personal access token that we have saved and hit enter.

Enter name for your Agent, Press enter for default _work Folder , Press enter to use Agent as service and Press enter for NT AUTHORITY\NETWORK SERVICE

Go to Agent Pools -> Default -> Agents (Tab) You will see Agent is online. You have successfully deployed a Windows 10 machine Agent.

Setup UFT Azure DevOps Extension on the Self Hosted Windows Agent(Slave).

  1. Download the following files from the ADM-TFS-Extension GitHub repository into the folder that you want to use for the UFT-Azure integration.
  2. UFT.zip
  3. Unzip UFT.zip into the agent folder

4. Set the Environment Variable UFT_LAUNCHER to point on the UFTWorking folder

Install UFT Azure DevOps extension on Server Machine (Master)

Go to Azure Devops Account -> “Browse marketplace”

Search for “UFT”

Click Install

After installation click “Proceed of organization”

Setup a VBS file to trigger the UFT tests

In the script root folder, create UFTExecutionEngine.vbs file and paste the following code.

Test-Path -C:\agent\_work\1\s

Create a Reports folder under script root folder – result path – C:\agent\_work\1\s\Reports

testPath = "C:\agent\_work\1\s"
Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
DoesFolderExist = objFSO.FolderExists(testPath)
Set objFSO = Nothing
If DoesFolderExist Then
Dim qtApp
Dim qtTest
Dim qtResultsOpt
Set qtApp = CreateObject("QuickTest.Application")
qtApp.Launch
qtApp.Visible = False
qtApp.Open testPath, False
Set qtTest = qtApp.Test
Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions")
qtResultsOpt.ResultsLocation = "C:\agent\_work\1\s\Reports"
qtTest.Run qtResultsOpt,True
qtTest.Run
qtTest.Close
qtApp.Quit
Else
Wscript.Echo "Test is not found at"&testPath 
End If

Push the above script to a version system supported by Azure Devops.

Create and Setup azure pipeline

Click “New Pipeline” and click “classic editor”. Select a Source

Make connection if not connected to source and select the repository. Click Continue.

Click “Empty job”

Enter pipeline name and select the “Default” agent pool.

Add a job to pipeline by Click “+”  on Agent job 1 and search for “cmd” and Click Add.

Enter the below code in “Script” .

cd c:\windows\syswow64
cscript.exe "C:\agent\_work\1\s\UFTExecutionEngine.vbs"
exit

Add “UFT_LAUNCHER” in pipeline variable.

Run the pipeline by clicking “Save & queue”

References:

https://admhelp.microfocus.com/uft/en/15.0/UFT_Help/Content/UFT_Tools/ Azure_DevOps_Extension/uft-azure-devops.htm

Categories: UFT/QTP

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s