How to run same test cases in different URL?

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.

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.

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.

1 Like

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.

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.

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.

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.

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.

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.

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

Kindly help me out
I have create simple test case

  1. Open Browser
  2. Navigate To Url

I want to open multiple URL
how to open in one test case / test suite

I made a CSV file ~/HostList.csv where I listed 2 host names, namely one is the Production env, other is the Mimic env.

HOST
demoaut.katalon.com
demoaut-mimic.kazurayam.com

and I created a Test Suite in Katalon Recorder
SampleTestSuite.html (807 Bytes)

  • The Test Case loads lines of CSV by loadVars command
  • It iterates over the lines while a variable ${HOST} is interpolated with the loaded value.
  • It repeats a sequence of statements enclosed by loadVars and endLoadVars

When I ran it, it sequentially opened 2 URLs.

@Noor_Ahmed_Khan

Is it what you want?

1 Like

Any one help me out ?