Skip to main content

[SpecFlow+Runner] Override the value of testThreadCount variable from Azure Pipelines


1 comment

  • Vladyslav Kaliuzhnyi

    You could easily do that via simple powershell task in Azure DevOps. All you need is to have .srprofile copied to some place where your test agent resides. And then just make this testThreadCount value an AzDo variable.


    $file = "$(SearchFolder)\Default.srprofile"

    [xml]$config = Get-Content $file
    $ns = New-Object System.Xml.XmlNamespaceManager($config.NameTable)
    $ns.AddNamespace("ns", $config.DocumentElement.NamespaceURI)
    $node = $config.SelectSingleNode("//ns:TestProfile//ns:Execution", $ns)
    $node.SetAttribute("testThreadCount", "$(NumberOfThreads)")

    $(SearchFolder) is a place where your file is stored.


Please sign in to leave a comment.

Powered by Zendesk