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.
Supported in UFT versions 14.51 and higher
UFT supports Git branches with the following commands
Create a new Git branch using the test currently open.
Do the following:
Switch to the same test in a different Git branch.
Do the following:
UFT re-opens the test from the selected branch.
Merge data from a different branch into the branch currently open in UFT.
In the Solution Explorer, right-click the test, and select Git Merge Branches.
Your data is merged into the selected branch. UFT re-opens your test in the same branch you started in from before the merge.