Karate + Gradle : Is there a way to get environment variable value in a .java file and define Postgres DB configuration based on env variable value?

Viewed 15

I have a karate framework based application for API testing using Gradle, which stores API response into Postgres DB. I wanted to make Postgres DB configuration based on environment variable, which is passed through command line,

>gradlew test -Dkarate.env=stage

As i am a frontend developer, spent lot of time on this but still no luck. Suggest me a better solution for this, thanks

0 Answers
Related