Skip to main content

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

Comments

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.

    Example:

    $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)")
    $config.save($file)

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

    1

Please sign in to leave a comment.

Powered by Zendesk