How to data bind Global Variable?

Hello, newbie here in using Katalon Studio… I want to know if there are possible ways to get data from excel and store it in a Global Variable? Thank You in advance.

there are some workarounds …

but, IMHO, will be better if you describe the workflow you intend to achieve

Honestly, i see no real reason to export a value from TestData to Globals … since the var:value it is already available as it is during the iteration …

Thanks Ibus! What I want to achieve is create a Login keyword so whenever there’s a login process for my test cases I will just call the login keyword. I’ve already done it with the static username and password which is declared inside the .groovy but the problem is the username and password should not be static. It should be dynamic since there are a lot of users that’s why I wanted to use data binding in global variable. Would it be possible? or is there any other solutions? Thanks for the help!

1 Like

You can use the workaround proposed by Sergii to generate GlobalVars on-the-fly:

https://docs.katalon.com/katalon-studio/docs/create-global-variables-on-the-fly.html

Otherwise, you can simply declare the variable in the used Profile with a default value and simply set the value during test execution.

For reading the data from a given file, you can use the findTestData method:

https://api-docs.katalon.com/com/kms/katalon/core/testdata/TestDataFactory.html

1 Like

Thank You so much Ibus!

but that method not work!!! always fail!

which one?

Create Global Variables on the fly

for other people is working