How to use runsettings file(TestContext) in Specflow project.
I can not figure out how I should do to be able to read parameters from runsettings file via TestContext.
0
-
NUnit.Framework.TestContext.Parameters.Get(....) returns null.
0 -
We work with this, with a runsettings file like:
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<TestRunParameters>
<Parameter name="paramName" value="paramValue" />
</TestRunParameters>
</RunSettings>And accessing the parameters like:
var testParams = NUnit.Framework.TestContext.Parameters;
string myParam = testParams["paramName"];This works both by selecting runsettings file in VS and from command line used in CI/CD pipelines
0
Please sign in to leave a comment.
Comments
2 comments