Pass Katalon TestOps email and password as environment variables instead of hard coding in Project Settings?

Hi there,

I’m currently integrating my Katalon Studio project with Katalon TestOps, and I noticed that in the Project Settings → Katalon Platform section, the configuration requires entering an Email and Password for authentication.

I’d like to avoid storing credentials directly in the project file and instead pass them as environment variables (for example, through Global variables/GitHub Actions secrets).

Is there a way to configure Katalon Studio to read the TestOps credentials — Email and Password — from environment variables or external configuration instead of hardcoding them in the project settings?

2 Likes

hi @praveen.subramani
if you want to pass the credentials thru ENV var, you can do it like this (using API key instead):

katalonc
-noSplash
-runMode=console
-projectPath="C:\Users\username\Desktop\Katalon Studio\MyProject\MyProject.prj"
-testSuitePath="Test Suites/MyTestSuite"
-browserType="Chrome"
-executionProfile="default"
-apiKey="YOUR_API_KEY"
1 Like

Hi @depapp, as shown in the attached image, I’ve used the email testUser@gmail.com. I’d like to store and pass this email and its corresponding password using environment variables like globalVariable or some form of global configuration.

Global Variables (Not for TestOps Auth)

  • Katalon’s GlobalVariable system is intended for test data and parameters, not core system authentication—there is no built-in way to map a global variable to the TestOps authentication fields in project settings.

Recommended: Use TestOps API Key Instead

  • When running tests from the CLI (katalonc command), you can pass the -apiKey="YOUR_API_KEY" option instead of Email/Password.
  • This is best practice for automation and CI/CD, since API keys can be securely managed as environment variables or CI secrets (e.g. in GitHub Actions, Jenkins, Azure DevOps).​
  • Example for console execution:
katalonc \
  -noSplash \
  -runMode=console \
  -projectPath="C:\Users\username\MyProject.prj" \
  -testSuitePath="Test Suites/MySuite" \
  -browserType="Chrome" \
  -apiKey="$KATALON_API_KEY"

Store your API key in an environment variable or secret provider and reference it, ensuring you avoid hardcoding sensitive credentials.

@dineshh
yes, I’ve used exactly what you’ve mentioned

but getting this below error

My question is, if we haven’t configured the integration within Katalon Studio (UI), how will the test results be uploaded to TestOps during CI/CD execution using only the API key, since we haven’t specified the organization ID or project ID anywhere?

hi @praveen.subramani
if your goal is to add the specific organization ID / project ID, you can pass these 2 params on your command line:

-orgID=<your_org_id>
-testOpsProjectId=<your_project_id> 

reference: Command-line syntax in Katalon Runtime Engine | Katalon Docs

1 Like

Based on the official Katalon documentation, here’s what you need to know about credential management for TestOps integration:


Problem Analysis

You want to avoid hardcoding TestOps credentials (Email and Password) in your project settings and instead use environment variables or external configuration, especially for CI/CD pipelines like GitHub Actions.

Current Limitation: Direct Environment Variable Support

According to the official documentation on Katalon Platform integration:

:cross_mark: Katalon Studio does NOT directly support reading Email/Password from environment variables in the Project Settings UI.

The credentials are stored in:

<project_folder>/settings/internal/com.kms.katalon.integration.analytics.properties

This is a static configuration file, not a dynamic environment variable reader.


Recommended Solution: Use Katalon API Key Instead

The BEST and MOST SECURE approach is to use a Katalon API Key instead of Email/Password credentials. According to the Katalon API Key documentation:

:white_check_mark: API Keys are designed for:

  • Integrating Katalon Studio with TestOps in console mode
  • CI/CD pipeline integrations (Jenkins, CircleCI, GitHub Actions, etc.)
  • Secure credential management

Step 1: Generate a Katalon API Key

  1. Sign in to Katalon TestOps
  2. Click your AvatarUser SettingsKatalon API Key
  3. Click Create API Key
  4. Enter a name and expiration period
  5. Click Create and copy the key

Step 2: Use API Key in Console Mode (CI/CD)

For GitHub Actions or other CI/CD systems, use the command-line approach with the API key:

# Example: Running tests with API Key
katalon -noSplash -runMode=console \
  -projectPath="<path_to_project>" \
  -testSuitePath="<path_to_test_suite>" \
  -apiKey="<your_katalon_api_key>" \
  -orgId="<organization_id>" \
  -testOpsProjectId="<testops_project_id>"

GitHub Actions Example:

name: Run Katalon Tests

on: [push]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      
      - name: Run Katalon Tests
        run: |
          katalon -noSplash -runMode=console \
            -projectPath="${{ github.workspace }}" \
            -testSuitePath="Tests/MyTestSuite" \
            -apiKey="${{ secrets.KATALON_API_KEY }}" \
            -orgId="<org_id>" \
            -testOpsProjectId="<project_id>"

Alternative: Override Authentication with Environment Variables (Limited)

If you must use the Override Authentication option in the GUI, you can:

  1. Manually edit the properties file before running tests:

    # <project_folder>/settings/internal/com.kms.katalon.integration.analytics.properties
    analytics.authentication.email=your_email@example.com
    analytics.authentication.password=your_password
    
  2. Use a script to inject credentials before launching Katalon:

    # Bash example
    export KATALON_EMAIL="your_email@example.com"
    export KATALON_PASSWORD="your_password"
    
    # Then programmatically update the properties file
    sed -i "s|analytics.authentication.email=.*|analytics.authentication.email=$KATALON_EMAIL|" \
      <project>/settings/internal/com.kms.katalon.integration.analytics.properties
    

:warning: Warning: This approach is NOT recommended because:

  • Credentials are still stored in plain text
  • Less secure than API keys
  • Harder to manage in CI/CD pipelines

Best Practice Summary

Method Security CI/CD Friendly Recommended
Hardcoded Email/Password :cross_mark: Low :cross_mark: No :cross_mark: No
Environment Variables (Manual) :warning: Medium :warning: Partial :warning: Not Ideal
Katalon API Key :white_check_mark: High :white_check_mark: Yes :white_check_mark: YES

References


Recommendation: Switch to using Katalon API Keys for your CI/CD pipelines. This is the official, secure, and recommended approach by Katalon for automated test execution and result uploads.