CXTM Variables
NetDevOps
  • Introduction
  • CXTM Basics
  • CXTM Projects
  • CXTM Test Cases
  • CXTM Test Automation
  • Revisit Imported Test Cases
  • CXTM Batches
  • CXTM Notifications
  • NetDevOps
  • CXTM Reporting
  • CXTM References
  • Bonus: Project Users
  • Bonus: CXTM REST API
  • Bonus: Secret Env Variables

Create CXTM Pipeline Variables

In this section of the lab, you will create variables in your GitLab project for your CXTM API Key and Host IP to be used in your pipeline. The CXTM related variables that you create in this section will be used by the cxtm-mgr client in your pipeline. cxtm-mgr is a websocket client designed to simplify websocket connections with CXTM. Through cxtm-mgr, you will instruct CXTM to execute the batches of test cases that you created earlier in the lab and allow GitLab to display the test case results directly in the pipeline.

The first thing you need to do before creating variables in GitLab is generate your CXTM API Key. Your CXTM API key will then be used as a secret environment variable in GitLab that you will access in the pipeline. This is a best practice as to not expose your API key.

Step 1 - Return to CXTM and Navigate to Your User Profile

In your browser, return to CXTM:

  1. In the top right corner, click on your user profile dropdown
  2. Click Manage Profile



Step 2 - Generate CXTM API Key

On the User Settings page, you should see that No API key has been assigned for your CXTM user.

  1. Click REQUEST API KEY



Note

If you find that an API Key has already been assigned, simply click Delete API Key and then Request API Key to create a new key

Step 3 - Copy CXTM API Key

After generating your CXTM API Key:

  1. With your mouse, click and highlight the generated API key
  2. Copy the API key you have highlighted with the keyboard shortcut Ctrl+c or right-click, and then click Copy



  3. Save this API Key in a text file for use in the next steps

Step 4 - Navigate to CI/CD Settings in Your GitLab Project

To store your CXTM API key as an environment variable in GitLab, return to your GitLab browser window and navigate to CI/CD settings in your GitLab project.

  1. Click Settings
  2. Click CI/CD


Step 5 - Navigate to CI/CD Variables

On your GitLab repo's CI/CD Settings page:

  1. Locate Variables
  2. Click Expand



Step 6 - Launch Add Variable Pop-up

Launch the Add Variable pop-up to add your CXTM API key as a variable:

  1. Click Add Variable



Step 7 - Add CXTM API Key Variable

In the Add Variable pop-up, fill out the fields as described below:

  1. Key: TM2_API_KEY
  2. Value: Paste in the CXTM API key you copied earlier
  3. Uncheck Protect variable
  4. Check Mask variable
  5. Click Add variable



Step 8 - Launch Add Variable Pop-UP

Launch the Add Variable pop-up in preparation to add your CXTM host as a variable:

  1. Click Add Variable



Step 9 - Add CXTM Host IP Variable

In the Add Variable pop-up, fill out the fields as described below:

  1. Key: CXTM
  2. Value: 10.0.205.11
  3. Uncheck Protect variable
  4. Check Mask variable
  5. Click Add variable



Step 10 - Confirm CXTM API Key and CXTM Host IP Variables are in GitLab

After clicking Add variable:

  1. Confirm TM2_API_KEY and CXTM variable was added to your project repo
  2. Return to home project repo page




Continue to the next section to create your GitLab CI pipeline file which will specify what your pipeline does.