How to run same test cases in different URL?


#1

I have to run same test cases in various environment like Dev environment, Test environment, demo environment and live environment ( different URLs).

How can i use recorder to run it?

Thank you.


#2

Hi tracey. This is possible using the concept of “Execution Profiles” within Katalon Studio. This feature is located at the bottom left below the “Reports” feature.

Simply create 4 different execution profiles and call them Dev, Test, Live and Demo. You can then specify your URLs in here for each of these environments. When executing a particular Test Case or Test Suite, you can then select which Execution profile they will operate under.

I am in the process of experimenting with these with some success so far.


#3

Many of the Katalon examples show a Global Variable for the baseurl.
For my tests, I have implemented that as well.
As noted, create an execution profile.
Create a variable called baseurl
Set the initial value to be the url of the different environment, such as http://katalon-qa.com
Within the test, refer to WebUI.navigateToUrl(GlobalVariable.baseurl) to use the URL of the site.
Use the same variable name in each Execution Profile and the code will execute in the correct environment.


#4

Hi Peter and M2018,

First of all thank you for your reply and guidance provided to me.

I am actually running the test cases by using Katalon recorder IDE.

Is there any method in Katalon Recorder IDE that can use to perform execution profile or global variables?

Thank you in advance.


#5

It’s relatively easy to implement with Katalon Recover, however, it comes with the one caveat with the solution I’ve created, you will need to alter the URL of the variable before executing the script (there is potentially a way to make this step easier too, but it’d require more code).

The following example would allow what you want:

storeEval | “www.google.com.au” | BaseURL
open | https://${BaseURL}/maps |

In this case the /maps being the relative URL, but obviously, you can use whatever relative URL you want there.


#6

Alternatively, you can make 4 different test cases that have the same script, but different URL, and stick them into a test suite to run one after the other.


#7

andrew said:

Alternatively, you can make 4 different test cases that have the same script, but different URL, and stick them into a test suite to run one after the other.

The issue with that then becomes maintenance. At least when using a variable, then all you need to do is to fix a single version of the script and not have to re-do the same edits across all 4.


#8

yaya…Cybes, this is what i wish to have. Thank you.

Temporary I use the CSV file to keep the url for every environments.
So I just re-upload the CSV file when I finish run the few test suites in one environment.


#9

There was a solution for Selenium-IDE with the command “forXML”: https://addons.mozilla.org/de/firefox/addon/selenium-ide-sel-blocks/versions/. The different runs for the test were stored in a xml-file in separate lines.
The point is, that the csv-file (option "data driven) does not support this. But it would be nice.


#10

i know it’s old but maybe it will be helpful for someone. You don’t have to reload csv file. You an store every URL’s in CSV and just change the line from witch it should be read. Command to read value specific line in CSV file is storeCsv. More details here: Please help on Katalon Recorder Data-Driven using CSV