I checked almost all stack overflow and Microsoft documentation on how to read parameters from .runsettings file in MSTest and tried all the approaches but none worked for me.
I am using .NETCore 2.2, VS 2019, Selenium, SpecFlow+ Runner.
Does not Work with SpecRun.SpecFlow nuget Package but works with SpecFlow.MStest nuget package.
I tried to use it as mentioned here:
None of them worked for me.
.runsettings file:
`
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<TestRunParameters>
<Parameter name="appUrl" value="http://example.com" />
</TestRunParameters>
</RunSettings>
I tried to get "appUrl":
public TestContext context {get;set;};
[ClassInitialize]
public static void TestClassinitialize(TestContext context)
{
var webAppUrl = context.Properties["appUrl"].ToString();
}
I tried [AssemblyIntilize]
/ [TestInitialize]
as well.
I don't know if MSTest supports this with SpecFlow+ Runner. Please help.
PLEASE HELP