Relevant for: GUI tests, API tests, and function libraries
Work with version control systems, such as SVN or GIT, directly from UFT.
If you are using SVN, you must use SVN version 1.8.x. If you are using GIT, use the GIT client version 2.5.2 or later.
If your source files are saved in an ALM project or a version-controlled ALM project, see Version Control in ALM.
Before using GIT or SVN inside UFT you must configure GIT or SVN locally:
Install the GIT or SVN client on the computer running UFT.
Set up your GIT or SVN workspace on your computer. For details on see your GIT or SVN documentation.
In UFT, create the test and save it in the folder configured to work with GIT or SVN.
Add the source files to your repository in GIT or SVN using the standard GIT and SVN commands.
When prompted, enter your user credentials:
SVN You are prompted for your user credentials the first time you add, update, or commit to an SVN repository from UFT. GIT You are prompted for your user credentials the first time you push to the remote repository.
To clear user credentials, select Tools > Clear All Credentials (Git/SVN). You'll be prompted to enter them on the next update or commit.
After setting up the workspace and adding source files, relevant icons are added to your testing nodes in the Solution Explorer. From then on, you can use SVN and GIT commands directly from the Solution Explorer.
Note: With large solutions and slow networks, the SVN and GIT icons may take a few moments to appear.
In such cases, you’ll need to wait until the icons refresh to perform commits, updates, and so on.
Update changes directly from the Solution Explorer.
Only source files that stand alone - those not dependent on a parent file, like an action to a test - can be updated directly from UFT.
For example, if you want to update changes from one action in a test or a local object repository in a test, you must commit the test.
To update a source file, do the following:
|SVN||Right-click the file name (or the parent file name), and select Update.|
Make sure that the folder containing the file is synced with the Git repository.
Right-click the file name and select Git Pull.
Note: If you need to clear your user credentials, select Tools > Clear All Credentials (Git/SVN). Your user credentials for the SVN or GIT repository are removed and you will be prompted to enter them on the next update or commit.
Commit changes directly from the Solution Explorer.
Only source files that stand alone - those not dependent on a parent file, like an action to a test - can be committed directly from UFT. For example, if you want to commit changes from one action in a test or a local object repository in a test, you must commit the test.
To commit changes, do the following after creating the file in UFT:
In the Solution Explorer, right-click the source file (or parent file) name and select Commit.
Note: If you have external source files associated with a test (such as an external action or a function library), the external files are not saved and committed when you commit the test. You must save the external files separately.
Specify your diff tool, such as the UFT Asset Comparison Tool.
These tools are specified in the Version Control Systems pane of the Options dialog box (Tools > Options > General tab > Version Control Systems node).
Do the following to perform a diff comparison of your source files:
In the Version Control System pane of the Options dialog box (Tools > Options > General tab > Version Control Systems node), specify a diff tool for each type of file.
In the Solution Explorer, right-click the file name, and select Diff with Previous Version.
The selected diff tool opens, enabling you to perform your diff comparison.
Right-click the file name in the Solution Explorer, and select Revert. UFT reloads the previous version as saved in the local copy of the repository and your changes are removed.
When there are conflicts between source file versions, UFT displays a dialog listing the conflicts, and enables you to choose which version of the file to save. You can also merge two versions of the file if necessary.
Do the following to resolve the conflicts:
In the conflict list dialog that opens, select a file with repository conflicts.
At the bottom of the dialog, choose one of the following options:
Use My Changes Saves the changes you made to the file and overwrites the version saved in the repository. Use Their Changes Takes the version in the repository and overwrites your changes. Merge
Merges both versions together.
You must define a specific tool for merging in the Version System pane of the Options dialog box (Tools > Options > General tab > Version System pane).
View in Explorer Open the folder containing the file, where you can manually modify the conflicts.
Commit the updated version.