.net core 运行设置文件不使用SpecFlow+;MSTest&x2B;SpecRun.Specflow

.net core 运行设置文件不使用SpecFlow+;MSTest&x2B;SpecRun.Specflow,.net-core,mstest,specflow,specrun,runsettings,.net Core,Mstest,Specflow,Specrun,Runsettings,我检查了几乎所有关于如何从MSTest中的.runsettings文件读取参数的堆栈溢出和Microsoft文档,并尝试了所有方法,但没有一种对我有效 我使用的是.NETCore 2.2,而不是2019,Selenium,SpecFlow+Runner。 不适用于SpecRun.SpecFlow numget包,但适用于SpecFlow.MStest numget包。 我试着使用它,正如这里提到的: 他们都不为我工作 .runsettings文件: ` 我也尝试了[AssemblyInit

我检查了几乎所有关于如何从MSTest中的.runsettings文件读取参数的堆栈溢出和Microsoft文档,并尝试了所有方法,但没有一种对我有效

我使用的是.NETCore 2.2,而不是2019,Selenium,SpecFlow+Runner。

不适用于SpecRun.SpecFlow numget包,但适用于SpecFlow.MStest numget包。

我试着使用它,正如这里提到的:

  • 他们都不为我工作

    .runsettings文件:

    `

    我也尝试了
    [AssemblyInitialize]
    /
    [TestInitialize]

    我不知道MSTest是否支持SpecFlow+Runner。 请帮忙


    请帮助

    这是一个
    公开问题:


    必须等待。

    正确。MSTest的RunSettings参数(和其他MSTest值)只能在用
    TestClass
    TestMethod
    属性修饰的类或方法中访问。@NATN233-当我使用
    SpecRun.SpecFlow numget包时,它不起作用,如下所述:
    https://specflow.org/getting-started/
    我编辑了你的标题编辑。在标题中添加“重新打开”是不合适的,也没有必要的。很明显,它之所以重新开放,是因为它不再显示[暂停]或[关闭]。请不要添加不需要的噪音和杂物。
    <?xml version="1.0" encoding="utf-8"?>
    <RunSettings>
        <TestRunParameters>
        <Parameter name="appUrl" value="http://example.com" />
      </TestRunParameters>
    </RunSettings>
    
     [ClassInitialize]
        public static void TestClassinitialize(TestContext context)
        {
          var webAppUrl = context.Properties["appUrl"].ToString();
        }