Katalon Studio Version: 5.4
Browser: Firefox 59.0.2
I’ve just opened my existing test project - which was previously created/maintained using Katalon Studio v5.3.1 - with Katalon Studio v5.4. As described in the release notes, my global variables have been moved to the default execution profile.
Whilst this is generally working fine, I’ve found that using global variables in a test case’s “variables” tab results in an error such as the following:
Test Cases/Scripts/Regression Tests/Application/By Area/Comments Tests FAILED because (of) Variable ‘username’ is not defined for test case.
Referencing the following test case code snippet:
// generate the login URL WebUI.navigateToUrl(WebUI.concatenate((([GlobalVariable.G_SiteURL, '/login']) as String), FailureHandling.STOP_ON_FAILURE)) // fill in the username and password WebUI.setText(findTestObject('General/Login/input_username'), username) WebUI.setText(findTestObject('General/Login/input_password'), password)
What this snippet does is provide the option of logging into an application using a default username and password (stored in the execution profile) or overriding the username/password used on a case by case basis. This code was working fine until v5.4, however now I find that:
- “G_SiteURL” is working fine
- “username” and “password” are both local variables to this test case. Both are configured with a default value type set to “Global Variable” and the default value set to the correct corresponding variable in the execution profile (eg GlobalVariable.G_Username and GlobalVariable.G_Password)
- The test case dies as soon as it tried to access the username variable
I believe that this is a bug with Katalon Studio and is not being caused by me using global variables/execution profiles incorrectly, however i’m happy for someone to point out if I’m wrong …