When using Called Test how do I use variable from the test I’m calling to

I am trying to use called tests, however I need to use variables in the called tests that will be defined from the test they are called too.

For example, I have a data file that queries our DB for a random user name. I want to set up a called test to use as a “login module” to reuse in all my tests. However the way I define the type of user I use the variables section of the test I’m trying to call login module to.

I want to use “userName” variable in the called test but have it execute from the variable in the specific tests…

how would I do this?

I have tried to go to window katalon studio preferences but this doesn’t help…

My lead developer came over to take a look at the Katalon Studio program. I’m not sure if this is what you meant but he was able to help me. I wanted to share with anyone else who is running into this issue.

I have login test case

in test case I define variable userName

I call for steps to log user into the system

userName is defined as variable in my login test case (not the called test)

in called test I have to define variable userName. I did this with the following:

variable
userName Map [:]

then when I call the test I set up this:

Call Test Case Login_Module (this is my called test) [userName:userName]

in that call test I have row binding I inserted one row. it has
Key type = String
Key = “userName”
Value Type = Variable
Value = userName

Where would I find the Web UI sample project?

For login_ms I have a variable userName. The user name is pulled as a data file from a DB query. If I run this in the test case I can define the variable in the login case sensitive test. It stores it with user name, and customer name. I define both as their own variable. If I do a called test it requires me to set the variable on the called test. I don’t want this as the variable is then not usable in the test I am calling too. I am try this as a simple intro to katalon.

browse to web page
search db for user name
enter user name
enter password
login
verify user is logged in
logout
in login page reenter username as all uppercase
enter password
login
verify user is logged in
close browser

I have other tests I have tried and in other tests I am utilizing userName and customerName.

I want to create a modular system where I can build the modules together without having to rewrite the same code lines in every test

Can I not define the variable in the test I am calling too?
Login_MS is the module step I want to use in all my test cases. I want that value of user name defined in the test. So this way if I call the test for a user with X, Y and Z permissions then call it again for another test that user has permissions A, B and C.

If I call and define the variable userName at this level wouldn’t Have to define my query there too?