Create variable can use within a folder of test case or test suite

I try to create a variable to run only in a folder of the test case, but I can not. Can anyone help me?
I looking for a solution for the test suite, but not yet.
Is that possible? Please help me

I am assuming that you are creating a variable in one test case in a folder which contains a set of test cases and trying to access that variable in other test cases in the folder.
The variable in one test case can be used in other only when it is imported into the test case.
A variable is private to that test case itself.
In order to use it call the test case which contains the variable in this testcase.
Test case 1:
String a

Test case 2:
WebUI.callTestCase(findTestCase(‘Test case 1’))

So wherever you want to use the declared variable call the test case 1.

What do you mean? Can’t create?

Maybe like this?

I create variable in test case A, but can not use in test case B, they in same folder.

WebUI.callTestCase(findTestCase(‘User_Setting/variable’), [(‘variable’) : ‘abcde’], FailureHandling.CONTINUE_ON_FAILURE)


But I can not print “variable”

Hi @cavoidc

It seems what you’re looking for is a global variable, you can define it in Profile section and call it in the test cae by GlobalVariable.your_variable_name

Sharing variables between test cases is what global variables are for.

Thanks, bro, but I try to look for a variable can cross test case within test folder.
Global variable I use for other perpoose

bro, testcases are groovy scripts, read a bit about them:

you cannot share variables through folders, but by object scopes …