# Need help passing variables between test cases in Katalon Studio

**URL:** <https://forum.katalon.com/t/need-help-passing-variables-between-test-cases-in-katalon-studio/129359>\
**Category:** Miscellaneous\
**Tags:** test-case-variables\
**Created:** [April 25, 2024, 2:52am UTC](https://forum.katalon.com/t/need-help-passing-variables-between-test-cases-in-katalon-studio/129359 "2024-04-25T02:52:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![coucou](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/coucou/32/23869_2.png) [@coucou](https://forum.katalon.com/u/coucou)\
**Post date:** [April 25, 2024, 2:52am UTC](https://forum.katalon.com/t/need-help-passing-variables-between-test-cases-in-katalon-studio/129359/1 "2024-04-25T02:52:59Z")

</div>

Hi everyone,

I’ve tried numerous things in the Katalon interface and searched the internet and this forum. I’ve found some answers, but I must be too dumb to understand what to do. ¯ \ \_ (ツ) \_ / ¯

I’m currently evaluating Katalon Studio for potential integration into our production environment. I’ve been running a lot of small tests to figure things out.

Here’s my situation:  
The test case TC0503 has two variables: usernameTC and passwordTC. These variables are mapped to a Data File TC0503 which contains two corresponding columns: username and password.

Login is another test case. It also has its variables and dataset with a specific Data File. Login includes several Custom Keywords methods, one of which is used to input login credentials into the application:

`loginProcedure(String username, String password) {}`

TC0503 starts by calling the Login test case. I’m trying to figure out how to specify to Login that I want to send it the contents of the TC0503 variables usernameTC and passwordTC.

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/f/b/fb868db3299dac2e149e4d736b877564a6907f28.png)

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/9/2/9239569307efb31eae0fec521ed872c9396148d7.png)

I’m not running this as part of a test suite.

Thanks for your attention. I really appreciate any help you can provide!

---

<div class="post-metadata">

**Author:** ![Elly\_Tran](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/elly_tran/32/21874_2.png) [@Elly\_Tran](https://forum.katalon.com/u/Elly_Tran)\
**Post date:** [April 25, 2024, 2:53am UTC](https://forum.katalon.com/t/need-help-passing-variables-between-test-cases-in-katalon-studio/129359/2 "2024-04-25T02:53:25Z")

</div>

Hi @coucou ,

Welcome to our community. Everyone here is willing to help you

---

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [April 25, 2024, 4:09am UTC](https://forum.katalon.com/t/need-help-passing-variables-between-test-cases-in-katalon-studio/129359/3 "2024-04-25T04:09:32Z")

</div>

You could possibly return the username and password:

1. in a Map (or Global Variable Map) that is created in your TC (see the Input reference of the last image you have above),
2. as two String Global Variables containing username and another for password,
3. as a `List<String>` that contains username and password…

---

<div class="post-metadata">

**Author:** ![coucou](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/coucou/32/23869_2.png) [@coucou](https://forum.katalon.com/u/coucou)\
**Post date:** [April 25, 2024, 2:36pm UTC](https://forum.katalon.com/t/need-help-passing-variables-between-test-cases-in-katalon-studio/129359/4 "2024-04-25T14:36:51Z")

</div>

Thank you for taking the time to answer me, grylion54.

I’m especially interested in your first solution. I want to avoid Global Variables.

From TC\_05\_03\_03 I want to target these custom keywords in TCLogin:

```auto
CustomKeywords.'loginLogout.Login.loginProcedure'(TCLogin_username, TCLogin_password)
CustomKeywords.'actuBU.modals.remplirModalPrincipal'(TCLogin_titre, TCLogin_description)

```

In TCLogin I’ve renamed the variables:

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/a/7/a7cee9a4e61837a538b1b676ebbc71ea48c905fa.png)

In TC\_05\_03\_03 I followed your advice:

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/f/0/f0517d40f910f5c7301a82af90aa992a90b7d102.png)

AFAIK this code is valid ([another example](http://forum.katalon.com/t/how-to-transfer-variable-from-a-test-case-to-another-test-case/37509/2?u=coucou)):

```auto
WebUI.callTestCase(findTestCase('LogInOut/Login'), [(TCLogin_username) : TC050303_username, (TCLogin_description) : TC050303_description,
	 (TCLogin_titre) : TC050303_title, (TCLogin_password) : TC050303_password], FailureHandling.STOP_ON_FAILURE)

```

I checked if my TC\_05\_03\_03 variables have any values and they do.

I get this error which makes no sense to me as I do have TCLogin variables listed as in use, as shown above:

> 2024-04-25 15:24:23.\> 443 ERROR c.k.katalon.core.main.TestCaseExecutor - ❌ Test Cases/ActuBu/TC\_05\_03\_03 FAILED.  
> Reason:  
> groovy.lang.MissingPropertyException: No such property: TCLogin\_username for class: Script1713517697054

Many thanks,

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/katalon/original/3X/d/5/d55596ab02785a255798e87ede769734747b30c4.svg) [@system](https://forum.katalon.com/u/system)\
**Post date:** [April 25, 2024, 2:36pm UTC](https://forum.katalon.com/t/need-help-passing-variables-between-test-cases-in-katalon-studio/129359/5 "2024-04-25T14:36:52Z")

</div>

Hi there,

Thank you very much for your topic. Please note that it may take a little while before a member of our community or from Katalon team responds to you.

Thanks!

---

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [April 25, 2024, 3:42pm UTC](https://forum.katalon.com/t/need-help-passing-variables-between-test-cases-in-katalon-studio/129359/6 "2024-04-25T15:42:55Z")

</div>

> [@coucou](#):
>
> groovy.lang.MissingPropertyException

The above error is indicating something is incorrect with “TCLogin\_username”. Perhaps a spelling error? You can use CTRL + C to copy the reference in one location and then CTRL + V (paste) on all the other same references to ensure they are all spelled the same.

Or your TC has come upon “TCLogin\_username” with no initialization of what data type the variable is.

---

<div class="post-metadata">

**Author:** ![coucou](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/coucou/32/23869_2.png) [@coucou](https://forum.katalon.com/u/coucou)\
**Post date:** [April 30, 2024, 12:14pm UTC](https://forum.katalon.com/t/need-help-passing-variables-between-test-cases-in-katalon-studio/129359/7 "2024-04-30T12:14:11Z")

</div>

Hi Mike,

Many thanks for your answer. I followed your advice and met another wall. Then I decided to recreate the same situation with two new test cases: anoLogin and anoTC05.

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/2/8/2879b4e689bc1807be888e61e3de7586e3e8e0a0.png)

My goal: to pass TC05’s variables values to anoLogin’s variables. Both tests have variables mapped to different test data sets.

anoLogin script:

```auto
WebUI.openBrowser('')
CustomKeywords.'browserLaunch.startProcedure.goToApp'(GlobalVariable.testUrl)
CustomKeywords.'loginLogout.Login.accueilLesObjetsSontPresents'()
CustomKeywords.'loginLogout.Login.notificationPopup'()
print("Local anoLogin test variables print :\n")
print("anoTCLogin_username: " + anoTCLogin_username + "\n")
print("anoTCLogin_password: " + anoTCLogin_password + "\n")
CustomKeywords.'loginLogout.Login.loginProcedure'(anoTCLogin_username, anoTCLogin_password)

```

If I run this test it works and prints are ok.

anoLogin variables:

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/b/a/ba7bf7da0ba5fa2e490abddf2850de689b39dd66.png)

anoLogin data bindings:

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/5/8/58d5539e51967ba51e78085f35ec40a4af8c8e90.png)

anoTC05:

```auto
print("Local anoTC05 test variables print :\n")
print("anoTC05_username: " + anoTC05_username + "\n")
print("anoTC05_password: " + anoTC05_password + "\n")
WebUI.callTestCase(findTestCase('anoLogin/anoLogin'), [(anoTCLogin_username) : anoTC05_username, (anoTCLogin_password) : anoTC05_password], FailureHandling.STOP_ON_FAILURE)

```

The print works with local variables. callTestCase seems to be OK to me, but not for Katalon.

anoTC05 variables:

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/8/a/8a3151244507bb127087aab102d3577e806754c1.png)

anoTC05 test data:

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/5/7/573de1d1a5292f7e1390265be94520e954ead48c.png)

Running anoTC05 leads to:

```auto
DEBUG testcase.anoTC05 - 4: callTestCase(findTestCase("anoLogin/anoLogin"), [anoTCLogin_username:anoTC05_username, anoTCLogin_password:anoTC05_password], STOP_ON_FAILURE)
2024-04-29 17:44:19.884 ERROR c.k.katalon.core.main.TestCaseExecutor - ❌ Test Cases/anoActubu/anoTC05 FAILED.
Reason:
groovy.lang.MissingPropertyException: No such property: anoTCLogin_username for class: Script1714124675762
	at anoTC05.run(anoTC05:24)
	at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
	at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
	at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:448)
	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)
	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)
	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)
	at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)
	at com.kms.katalon.core.common.CommonExecutor.accessTestCaseMainPhase(CommonExecutor.java:65)
	at com.kms.katalon.core.main.TestCaseBindingExecutor.accessTestCaseBindingMainPhase(TestCaseBindingExecutor.java:67)
	at com.kms.katalon.core.main.TestCaseBindingExecutor.execute(TestCaseBindingExecutor.java:44)
	at com.kms.katalon.core.main.TestCaseMain.startTestCaseBinding(TestCaseMain.java:185)
	at TempTestCaseBinding1714405450835.run(TempTestCaseBinding1714405450835.groovy:25)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

```

This is the same problem as above.

Katalon 9.4.0

Do you happen to have an idea?

Huge thanks,

---

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [April 30, 2024, 3:05pm UTC](https://forum.katalon.com/t/need-help-passing-variables-between-test-cases-in-katalon-studio/129359/8 "2024-04-30T15:05:12Z")

</div>

Now is the time to use Google to search on your issue:

> <https://stackoverflow.com/questions/16083995/groovy-lang-missingpropertyexception-no-such-property-manager-for-class-scrip>

> [@](#):
>
> One of the reasons **groovy.lang.MissingPropertyException:** is thrown when you are using a variable outside of its scope or you haven’t defined that variable.

Based on the **reason** above, I see you have your “missing property” in your parameter list:

> [@coucou](#):
>
> `findTestCase('anoLogin/anoLogin'), [(anoTCLogin_username)`

Perhaps the reference “(anoTCLogin\_username)” does not have a difinition or initiation yet?
