C#配置App.config以指定环境
我已从Github从以下位置下载了一个C#页面对象项目: 程序使用app.config文件标识要加载的页面对象 我想做的是:配置app.config文件以参数化测试环境。当前,当我想要更改测试环境时,我会搜索并替换app.config文件中的每个url字符串,直到所有url指向适当的测试环境。相反,我希望有一个参数,我可以设置它指向适当的测试环境 下面的app.config文件示例 提前谢谢C#配置App.config以指定环境,c#,app-config,C#,App Config,我已从Github从以下位置下载了一个C#页面对象项目: 程序使用app.config文件标识要加载的页面对象 我想做的是:配置app.config文件以参数化测试环境。当前,当我想要更改测试环境时,我会搜索并替换app.config文件中的每个url字符串,直到所有url指向适当的测试环境。相反,我希望有一个参数,我可以设置它指向适当的测试环境 下面的app.config文件示例 提前谢谢 <configuration> <configSections> &
<configuration>
<configSections>
<section name="Environments" type="NASOnline_TestFramework.Setup.EnvironmentsDataSection, NASOnline_TestFramework" />
</configSections>
<Environments>
<!--STAGE-->
<Environment>
<add name="LoginPage" url="https://svcrel.wn.nasinsurance.com" pageTitle="NAS Insurance Services, Inc." />
<!--Service Center Pages-->
<add name="LandingPage" url="https://svcrel.wn.nasinsurance.com/index.php?c=home.updates" pageTitle="NAS Insurance Services, Inc." />
<add name="ApplicationsPage" url="https://svcrel.wn.nasinsurance.com/index.php?c=app_list.list" pageTitle="NAS Insurance Services, Inc." />
<add name="PoliciesPage" url="https://svcrel.wn.nasinsurance.com/index.php?c=policy_list.list" pageTitle="NAS Insurance Services, Inc." />
<add name="ClientsPage" url="https://svcrel.wn.nasinsurance.com/index.php?c=insured_list.list" pageTitle="NAS Insurance Services, Inc." />