Update test URL automatically

I have several (20+) test cases that all browse to URLs with a JWT token, one URL per test case.

The URL is in the format https://<address>/?auth=xxxxxxx

We can generate new URLs with new JWT tokens automatically on our systems.

Is there any way of “injecting” this URL automatically into my test case scripts when we generate a new JWT token, rather than going through all of my test cases and updating them manually?

I’m assuming it’d be using variables, but I can’t find a way of bringing those variable values in from an external source?

Your guess is correct, you need to pull it in from outside into a variable.

There are a few ways. Personally, I prefer to use json files. Other people store them in a spreadsheet and pull them in that way, or even via CSV…

Let us know what kind of possibilities you would could useful your end.

if you are using CI/CD pipeline you can store url in variables of that pipeline then you can read system variables (usually variables of build can be accessed that way) and store them to global variables of profile and use them. for transfer we are using test listeners @beforeTestCase or @begoreTestSuite

Thank you for the replies, really appreciate them.

I’ve taken this information back to our dev teams and they’ve asked a couple of further questions…

  1. Is it possible to get a script to make a HTTP POST request to a non-Katalon URL? This will enable us to “grab” the updated URLs with JWT tokens when the scripts run
  2. If we can do 1, then we need to store 0Auth client credentials somewhere. Can this be done in the project settings, environment variables, something along those lines?

Thanks again all, really appreciate the help

Not sure what you’re asking. Aren’t most (almost all URLs) non-Katalon?

Maybe this will help - I don’t use any Katalon APIs to test WS. I do them all, either via browser based endpoints, or, where those aren’t available, I rig them up using raw JavaScript calls (XHR) in KS. My AUT supports interfacing to numerous hi-tech instruments – instrumentation which reads/writes data to/from said instruments, no browser(s) involved until the results are presented in a browser page somewhere.

For the reasons I stated above, I’m not 100% sure how you might do this (though I am sure you can do this). I’ll drag these guys in, they may know actual steps you can follow:

@Andrej_Podhajsky @bionel @ThanhTo