Databinding for multiple global variables

I have two slightly different URLs set up as global variables on a profile that I am trying to figure out how to bind to the test suite (so the test case will be run multiple times against the differing URLs). It does not appear that I can set the global variables up as values in the Data File - correct? How can I most easily accomplish this?


Are you able to place each URL in a separate profile? If so, you can create a Test Suite Collection that runs the same suite twice with the two separate profiles.

Define a local variable in our test case (variable tab).
This variable can have the url as value … or the global variable you already defined.
So when you run the testcase manually, this value will be used, think of it as a default value

Next, create a data file where you put all final values, create a test suite, bind the data file to the test-case in the suite.
Now, when you run the suite, the test-case will run once for each value you put in the Data file.

Easy as that!

Also, you can have in the Global only the common part to of the URL (usually i put only the domain, e.g for qa profile, for the px one) and in the testcase use additional parametrization for the rest of the url.This can work also using the same approach, with the benefit that will confuse the analysts attempting to understand how it works even more :smiley:

I’m doing all that in your first paragraph - it sounds like in the data file, you would add each URL separately in the file and then bind it to the local variable, correct? I figured this was probably the only way to handle it that made sense. Thanks!

To Brandon’s comment, I can but being that I want to have the suite run once across multiple production URLs that vary slightly, I’m not sure it is the right approach. Thanks though!

@Morgan the benefit of the data file is … if used properly, the test suite will iterate all test cases according to binding.
ofcourse, you can create also a lot of profiles and grab them into a collection …
the fun part with katalon is, you have lot of playroom to organize the project. more parametters, more flexibility

think at the data file as a mean to repeat a certain bunch of code with diferent data set, all over again. similar with the ‘mark.parametrize’ in pytest or data providers in C# approach

hint: you can use an sql query to mysql as a data provider :slight_smile:
when you build data (internal, sql, excel) … if the variables declared in test case have same name as declared in data provider, once you bind and hit ‘map all’ will be automagicaly discovered and paired.
if variable names are different, you have to map them one by one after you bind the data provider to the test case

Makes sense - thanks! I’ve been using data files for a bit now and agree with how it definitely helps with increasing flexibility of the test cases. I’ll add them there and be done with it. :slight_smile: Thank you!