如何在编码的ui测试中按顺序运行测试

问题描述:

你好,

当我在编码的ui测试中运行我的测试时,我想要一些测试。所以我使用下面的代码:

I want a few tests to be in order when i run my tests in coded ui tests. So i used the following code below:

[TestCategory(" first case"),TestMethod()]

[TestCategory("first case"), TestMethod()]

public void Test1()

public void Test1()

{}

[TestCategory(" second case"),TestMethod()]

[TestCategory("second case"), TestMethod()]

public void Test2()

public void Test2()

{}

[TestCategory(" third case"),TestMethod()]

[TestCategory("third case"), TestMethod()]

public void Test3()

public void Test3()

{}

[TestCategory(" 4th case"),TestMethod()]

[TestCategory("fourth case"), TestMethod()]

public void Test4()

public void Test4()

{}

[TestCategory(" Fifth case"),TestMethod()]

[TestCategory("fifth case"), TestMethod()]

public void Test5()

public void Test5()

{}

但测试没有按顺序进行。

But the test did not run in order. 

我有什么遗漏,请告知我们。 

Is there anything i am missing, Please let me know. 

感谢您的帮助。

谢谢

PV

朋友,

你的代码看起来很罚款。

You code looks fines.

但是您是否已在项目中添加 Ordered Test 文件?

But did you already add Ordered Test file in your project?

我的意思是:

右键单击项目名称 - >添加 - >有序测试

然后打开有序测试并在那里设置测试订单:

Then open the ordered test and set the test order there:

祝你好运,

Fletch