如何在编码的ui测试中按顺序运行测试 [英] How to run tests in Order in coded ui test

查看:67
本文介绍了如何在编码的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


这篇关于如何在编码的ui测试中按顺序运行测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆