Problems to solve
Let me assume, I have a single Web Application in multiple environments: the development, the staging, the production-blue, the production-green and more. These environments have 99% same contents and features except the following differences:
- Hostname — e.g.
demoaut-mimic.kazurayam.com
for development,demoaut.katalon.com
for production - Username/Password — e.g.
kazurayam/foobar
for development,John Doe/ThisIsNotAPassword
for production.
Now I want to:
- I want to use Katalon Studio to test Web UI of all these environments using a single set of Test Suites/Test Cases.
- I want to store the Katalon project into the GitHub and to expose it public (just as I did here).
- Still I want to hide my sensitive information: hostname, username and password. I do not like making them visible anywhere in the repository.
- I want to run the test against multiple targets (hostnames) in Continuous Integration process on Jenkins. In order to do this, I need to be able to switch the test target by command line argument without modifying the source code of the test at all.
**
My solution published**
I believe I have developed a solution to the above problems. I have made a running demo on GitHub. Please have a look at this:
https://github.com/kazurayam/KatalonPropertiesDemo
Related discussions
In the Katalon Discussion Forum I found quite a few discussions on test reuse, passing parameters to automated tests, and hiding credentials.
- Is it possible to use the same test for different sites?
- Automate running a test from maven (as part of build process)
- How to pass user defined parameters from command line
- How to pass the the parameter to the Test listener method…
- Want to overwrite credential info as GlobalVariable with properties file from command line argument
- How to change site based on environmet?
- Inject data with external file?
- Possibility to send property/variable through Katalon console cmd line
- Store variables like username and password
- Variable URL
- How to pass user defined parameters from command line
- Passing variables from jenkins to katalon scripts
- pass global variable value to Katalon in CMD line
- Maintain different environment properties file and run in multiple environment same time
I hope my study suggests something useful to those who may concern.