UFT and version control systems

Relevant for: GUI tests, API tests, and function libraries

Work with version control systems, such as SVN or GIT, directly from UFT.

Note:  

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 documents and resources are saved in an ALM project or a version-controlled ALM project, see Version Control in ALM

Set up UFT to work with GIT

Before using GIT inside UFT you must configure GIT locally:

  1. Install the GIT or SVN client on the computer running UFT.

  2. Set up your GIT workspace on your computer. For details on see your GIT documentation.

  3. In UFT, create the test and save it in the folder configured to work with GIT or SVN.

  4. Add the document to your repository in GIT or SVN using the standard GIT and SVN commands.

  5. 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.

    Note: If you need to clear your user credentials, select Tools > Clear All Credentials. 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.

After you set up the workspace and add a document to the workspace, the relevant icons are displayed in your testing documents in the Solution Explorer and you can use GIT commands for your documents directly from the Solution Explorer.

Back to top

Update changes for a document

Update changes directly from the Solution Explorer.

Only documents that stand alone - those not dependent on a parent document, 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 document, do the following:

SVN Right-click the document name (or the parent document name), and select Update.
GIT

Make sure that the folder containing the document is synced with the Git repository.

Right-click the document name and select Git Pull.

Note: If you need to clear your user credentials, select Tools > Clear All Credentials. 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.

Back to top

Commit changes for a document

Commit changes directly from the Solution Explorer.

Only documents that stand alone - those not dependent on a parent document, 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 test or document in UFT:

SVN

In the Solution Explorer, right-click the document (or parent document) name and select Commit.

GIT
  1. Make sure that the folder containing the document is synced with the Git repository.
  2. In the Solution Explorer, right-click the document and select Git Commit. This adds the test/document to the local repository (if necessary) and commits the changes.

    You can commit only tests and external resource files (like a function library, object repository, or recovery scenario to a repository.

  3. (Optional, when committing to the remote repository) In the Solution Explorer, right-click the document and select Git Push.
  4. In the dialog that opens, enter your personalized commit message. If you leave the field blank, the default message UFT commit is used.

Note: If you have external documents associated with a test (such as an external action or a function library), the external documents are not saved and committed when you commit the test. You must save the external document separately.

Back to top

Compare a document with the repository version

Use the default diff functionality, or specify another diff tool, including 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 documents:

  1. 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 document.

  2. In the Solution Explorer, right-click the document name, and select Diff with Previous Version.

    The selected diff tool opens, enabling you to perform your diff comparison.

Back to top

Revert a document

Right-click the document 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.

Back to top

Resolve conflicts between document versions

When there are conflicts between document versions, UFT displays a dialog listing the conflicts, and enables you to choose which version of the document to save. You can also merge two versions of the document if necessary.

Do the following to resolve the conflicts:

  1. In the conflict list dialog that opens, select a document with repository conflicts.

  2. At the bottom of the dialog, choose one of the following options:

    Use My Changes Saves the changes you made to the document 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 document, where you can manually modify the conflicts.
  3. Commit the updated version.

Back to top