简体   繁体   中英

Specflow: How to configure environment variables

I would like to configure environment variables like connection strings for my specflow tests in such a way that my tests should use my appsettings locally and use the values from keyvaults/pipeline environment variables while running in pipeline.I would like to achieve this without specifying any AddJsonFile. Any leads would be appreciated. Thanks.

You can set EnvironmentVariable:

Environment.SetEnvironmentVariable("lorem", "ipsum");

Environment.SetEnvironmentVariable Method

Creates, modifies, or deletes an environment variable stored in the current process.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM