There are many scripts that use the same strings/objects for different test cases. I am copying the same string declaration in those test cases. Is there a way to declare those strings once somewhere and reuse them in all the test cases? Note that I do not want to use Profiles (Global Variables) in this case.
Thanks.
Sounds very complex. I was hoping you would tell me to create a file (external or internal ) and declace my global strings in that file and reference that file somehow.
The problem with using global variables is that you cannot use more than one profile per test case. Thats one problem, so i had to regroup all my global variables into one profile. Plus i do not want to add the strings in there it will be too much. I was wondering if there is an easier way.
that’s not 100 % true. You can organize your variables between certain profile’s and the Default profile.
whatever variable is not found in the current selected profile will be picked from the default one (that’s the main reason the default profile cannot be deleted, must exist all the time)
I demoed this on a certain topic.
For more complex cases you can use a combination of global variables and external files, store in the global variable just the name/path to the file(s). That will give you enough flexibility.
It’s actually called loadProfileSettings() - the comment is wrong
utils is my code class - you will need to write your own. In Katalon you will need to create a custom keyword class and add the static method loadProfileSettings and import it in the test cases where you wish to use it.