简体   繁体   中英

Limit number of parallel threads in NUnit Project

I am running selenium test in parallel in an NUnit project and want to limit the number of test that are run at a time

Solution I found says to specify: [assembly: LevelOfParallelism(N)] to AssemblyInfo.cs, but my NUnit project does not have an AssemblyInfo.cs

I want to limit number of selenium test run executed in parallel in NUnit project

The documentation says might, it is not mandatory to be in AssemblyInfo.cs :

The following code, which might be placed in AssemblyInfo.cs


You could add [assembly:LevelOfParallelism(3)] to your test fixture .cs file. Take a look more about assembly attribute here .

using System;

[assembly: LevelOfParallelism(3)]

namespace YourNamespace
{
    [TestFixture]
    public class YourTextFixture
    {
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM