我使用SpecFlow来自动化我的网络测试,并使用并行执行来加快它们的速度。
我遇到的问题是,一个检查无效密码被拒绝的测试将锁定用户帐户,如果运行3次而没有成功登录。
我已经设置他们执行成功的登录之后,但是运行在并行方式针对多个目标,他们是在同一时间运行,并仍然锁定帐户。
我是否可以将这个测试设置为不并行运行,这样它就不会锁定帐户,并且仍然允许其他测试并行运行?
编辑--我使用SpecRun作为我的测试运行程序。
发布于 2017-10-17 10:54:58
我设法找到了解决我问题的办法。
通过将下面的代码放在我的srprofile中,我可以标记我希望按顺序运行的测试,并且它们只能在特定的线程中运行。
<TestThreads>
<TestThread id="0">
<TestAffinity>@Sequential | !@Sequential</TestAffinity>
</TestThread>
<TestThread id="1">
<TestAffinity>!@Sequential</TestAffinity>
</TestThread>
<TestThread id="2">
<TestAffinity>!@Sequential</TestAffinity>
</TestThread>
<TestThread id="3">
<TestAffinity>!@Sequential</TestAffinity>
</TestThread>
<TestThread id="4">
<TestAffinity>!@Sequential</TestAffinity>
</TestThread>
<TestThread id="5">
<TestAffinity>!@Sequential</TestAffinity>
</TestThread>
<TestThread id="6">
<TestAffinity>!@Sequential</TestAffinity>
</TestThread>
<TestThread id="7">
<TestAffinity>!@Sequential</TestAffinity>
</TestThread>
</TestThreads>https://stackoverflow.com/questions/46708083
复制相似问题