Gauge with c#, how to make db connection configurable.

44 views
Skip to first unread message

Sumit Choudhary

unread,
Apr 4, 2018, 4:15:57 AM4/4/18
to getgauge
Hi All,

I have created a Gauge Test Project in Visual Studio, now I want to make db connection to different environments. So that during the execution I can just pass the environment name as a parameter.


Alos if someone can help me in understanding how one can use default.properties value in code.

Thanks in advance.

Srikanth V

unread,
Apr 4, 2018, 4:42:58 AM4/4/18
to getgauge
Hi,

Please have a look at how you can use Environments to achieve this: https://docs.gauge.org/configuration.html#environments

The idea is: create a property with the same key in your properties file, and set the value specific to each environment,

Alternatively, since connectionstring can have sensitive information, you may choose to use OS environment variables to pass them into your code.

regards
Srikanth
Reply all
Reply to author
Forward
0 new messages