My Global Variable for the URL is just opening "about:blank"!

Hi everyone, I’m trying to follow best practices by not hardcoding my website URL. I went into Profiles, created a Global Variable called G_SiteURL, and set the value to https://my-testing-app.com.

But when I run my script, the browser opens up, stays on a blank white page for a few seconds, and then the test fails. It’s like Katalon isn’t even reading the variable. I tried calling it in my script like this:

Groovy

// My script line
WebUI.openBrowser(GlobalVariable.G_SiteURL)

In the Log Viewer, it says: PASSED - Open browser with url: ''

Wait, why is the URL empty? I definitely typed it into the Profile! I even tried restarting Katalon, but it still opens a blank page. Am I missing a step to “connect” the profile to the test?

8 Likes

Every Profile has its own name. What is the name of your Profile? Is it the “default” profile? or is it something unique like “myProf”?

The “default” profile will be automatically loaded. Every GlobalVariable in the default profile will be automatically available.

However, “myProf” profile will not be automatically loaded. You need to explicitly specify to do it. How? — See

1 Like

GlobalVariable G_SiteURL empty because wrong Profile selected/not active—“default” auto-loads, custom Profiles need explicit selection.

Fix

  1. Run > Execution Settings (or Test Suite > Override Profile dropdown) → Select your Profile name.
  2. Verify: Profiles > [Your Profile] > G_SiteURL shows https://my-testing-app.com.
  3. Test: println GlobalVariable.G_SiteURL → Should print URL, not blank.

Script shows url: '' confirms Profile not loaded. Always set Profile before running Test Case/Suite. Default Profile auto-applies if unspecified.

I might make another thread, but since trying Katalon 11, profile inheritance is broken.

default.glbl

   <GlobalVariableEntity>
      <description></description>
      <initValue>[('vs') : 1, ('s') : 5, ('m') : 15, ('l') : 30, ('vl') : 150]</initValue>
      <name>wait</name>
      <protected>false</protected>
   </GlobalVariableEntity>

stg.glbl does not contain a variable named wait

Test Case script:

import internal.GlobalVariable as GlobalVariable

println GlobalVariable.wait

Run with default profile selected:

[vs:1, s:5, m:15, l:30, vl:150]

Run with stg profile selected:

null

This could be what’s happening to OP

Bro you are making slight error ,

openBrowser():

  • Only launches the browse

After that command you need to use WebUI.navigateToUrl() to oen the desired url

Solutions: So in your code please use

WebUI.openBrowser(‘’)
WebUI.navigateToUrl(GlobalVariable.G_SiteURL)

It will pick up

I followed the steps based on your comment and was able to confirm that it works
KS version used in my screenshot is 11.0.0

That’s good to see. It is however very much not working for me. I’m working in projects that have been around since Katalon v7, and are now being upgraded to v11. We’re holding off on upgrading to v11 because this issue is pervasive across all projects in the enterprise. This is replicated by every member of my team.

Katalon team is looking at it for us in this bug report thread: Troubleshooting profile inheritance in Katalon 11 - Bug Report - Katalon Community

What you are experiencing is an Execution Profile Mismatch. This is one of the most common hurdles for beginners. In Katalon Studio, defining a variable in a Profile is only half the battle; you must explicitly tell Katalon which Profile to use during the execution. By default, Katalon uses the “default” profile. If your variable is in a profile named “Staging” or “Production,” but the “default” profile is empty, the variable returns a null or empty string.

The Solution: Selecting the Active Profile

You don’t need to change your code; you need to change your Execution Context.

  1. Check the Execution Selector: Look at the top toolbar in Katalon Studio, next to the “Run” (Play) button. There is a dropdown menu that usually says default.

  2. Switch Profile: Click that dropdown and select the specific Profile where you defined G_SiteURL.

  3. Verify Variable Typing: Ensure the variable “Type” in your Profile is set to String and not something else.

Custom Keyword: The “URL Guard”

To prevent your tests from failing with confusing “blank page” errors, you can create a Custom Keyword that validates the Global Variable before the browser even opens. This is a “Fail-Fast” architectural strategy.

Groovy

package com.config.utils

import com.kms.katalon.core.annotation.Keyword
import com.kms.katalon.core.util.KeywordUtil
import internal.GlobalVariable

public class ConfigValidator {

    /**
     * Checks if the Global URL is valid before starting the test
     */
    @Keyword
    def verifyGlobalUrl() {
        String url = GlobalVariable.G_SiteURL
        
        if (url == null || url.isEmpty() || url.trim() == "") {
            KeywordUtil.markFailedAndStop("ERROR: GlobalVariable.G_SiteURL is empty! Check if you selected the correct Execution Profile.")
        } else {
            println "Proceeding with environment URL: " + url
        }
    }
}

Strategic Advice:

  • The Default Profile Strategy: A common expert tip is to put your “Local” or “Dev” environment settings in the default profile. This way, if you forget to switch profiles, the test still runs against a safe environment.

  • Check the ‘Internal’ folder: In the Script view, ensure your import says import internal.GlobalVariable as GlobalVariable. If this import is missing or corrupted, Katalon won’t recognize the variable.

  • Console Log Check: Always look at the very first few lines of the Console tab. It will say Variable 'G_SiteURL' is set to .... If it says null, the Profile hasn’t loaded.

Did you create a new Profile for your URL, or did you add the variable to the existing “default” profile?

6 Likes

Profiles Issues. Check Active profile while execution.

2 Likes

I used

  • macOS 26.3.1
  • Katalon Studio 11.1.1 (non Enterprise)

I opened a Katalon Studio project; I had the Exection Profile default already; I added a new Excecution Profile stg;

While I DON’T mark the stg as default, I looked at the file in the project directory: Libs/internal/GlobalVariable.groovy.

package internal

import com.kms.katalon.core.configuration.RunConfiguration
import com.kms.katalon.core.main.TestCaseMain


/**
 * This class is generated automatically by Katalon Studio and should not be modified or deleted.
 */
public class GlobalVariable {
     
    /**
     * <p></p>
     */
    public static Object wait
     

    static {
        try {
            def selectedVariables = TestCaseMain.getGlobalVariables('default')
			selectedVariables += TestCaseMain.getGlobalVariables(RunConfiguration.getExecutionProfile())
    
            wait = selectedVariables['wait']
            
        } catch (Exception e) {
            TestCaseMain.logGlobalVariableError(e)
        }
    }
}

The following line is especially interesting:

def selectedVariables = TestCaseMain.getGlobalVariables('default')

Then I marked the Execution Profile stg to be the default.

And I looked into the Libs/internal/GlobalVariable.groovy file again. It was changed to:

package internal

import com.kms.katalon.core.configuration.RunConfiguration
import com.kms.katalon.core.main.TestCaseMain


/**
 * This class is generated automatically by Katalon Studio and should not be modified or deleted.
 */
public class GlobalVariable {
     
    /**
     * <p></p>
     */
    public static Object wait
     

    static {
        try {
            def selectedVariables = TestCaseMain.getGlobalVariables('stg')
			selectedVariables += TestCaseMain.getGlobalVariables(RunConfiguration.getExecutionProfile())
    
            wait = selectedVariables['wait']
            
        } catch (Exception e) {
            TestCaseMain.logGlobalVariableError(e)
        }
    }
}

The following line is interesting:

def selectedVariables = TestCaseMain.getGlobalVariables('stg')

The code explains what’s going on internally.

1 Like

Pls let us know whether you got solutions or not?

hi @tglover-davis

The empty URL in the log confirms your profile isn’t loading at runtime. If you created the variable in a custom profile (not “default”), you have to explicitly select it. The default profile auto-loads; custom ones do not.

Right-click your test suite, go to Execution Settings, and select your profile from the dropdown. If running a standalone test case, go to Run > Execution Settings and pick the profile there.

Quick sanity check: add println GlobalVariable.G_SiteURL before the openBrowser call. If it prints null, the profile is definitely not active.