I’m facing some trouble with environment variables.
In my project, I have some external jar dependencies. One of them is a library that I, myself, have developed and also have been using for the past 6 months with no problem at all, but recently I moved from Windows to MacOS and I am not capable of getting the environment variables that are called inside this library (System.getenv()).
These environment variables are set in the bash profile and, from inside the library or any other location, I can use and see them correctly. The problem is when I use the library from inside Katalon. Library methods are called but variables seem to be not recovered.
Does anyone know why is this happening?
Any response would be appreciated.
How do you start Katalon Studio on Mac? Possibly you would click the KS icon in the Dock to launch it. In this way your
~/.bash_profile will not be referred to, and the environment variables will not be present.
A workaround: open Mac Terminal app to activate a bash interpreter (
~/.bash_profile will be sourced and environment variables will be created), then launch KS by executing a command :
$ /Applications/Katalon\ Studio.app/Contents/MacOS/katalon
The environment variables are, in some situations, difficult to configure.
You can change the library, can’t you? Then you can make the library configurable by some alternative way other than the environment variables.
That worked! I’ll try to change things inside the library but for now, it is not possible bc the library is used for more applications that need an environment variable.