在关联的自动化中访问MTM测试用例ID [英] Accessing MTM test case Id in an associated automation

查看:162
本文介绍了在关联的自动化中访问MTM测试用例ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已在编码的UI中创建了自动化框架,并将其与MTM中的多个测试用例相关联,现在运行MTM测试 与相关的自动化案例.该框架将提取MTM测试用例的测试用例ID,并根据该MTM测试用例中提供的参数执行测试用例. < o:p></o:p>

I have created automation framework in coded UI and associated that to multiple test cases in MTM and now run MTM test case with associated automation. That framework will extract the test case id of MTM test case and execute the test case based on the parameters provided in that MTM test case. <o:p></o:p>

但是,现在,当我从MTM中选择多个测试用例并运行时,它将使用最后一个测试用例ID并全部运行该参数上的脚本.例如

我在MTM中有3个测试用例,即方案1,方案2,方案3.
Scenario1具有参数:ScenarioID:4
Scenario2具有参数:ScenarioID:5
Scenario3具有参数:ScenarioID:6

I have 3 test cases in MTM i.e. Scenario1, scenario2, scenario3.
Scenario1 has parameter :ScenarioID:4
Scenario2 has parameter :ScenarioID:5
Scenario3 has parameter :ScenarioID:6

当我选择所有测试用例并使用选项运行那些测试用例时.
测试用例在测试代理上成功运行.但是所有测试用例都使用Scenario3的参数运行,即参数值为6.
不过,当我运行单个测试用例时,它会提取正确的id并仅使用其参数.

When I select all the test cases and run those test cases with options.
Test cases run on test agent successfully. But all the test cases are running with parameter of Scenario3 i.e. parameter with value 6.
However when i am running single test cases than it is extracting correct id and taking its parameter only.

请帮助我,如何在同时运行多个测试用例以及相关联的相同用例时提取MTM测试用例ID全部测试方法.

谢谢.

推荐答案

SyAlia,

Hi SyAlia,

>>我已在编码的UI中创建了自动化框架,并将其与MTM中的多个测试用例相关联

>>I have created automation framework in coded UI and associated that to multiple test cases in MTM

能否请您告诉我您如何定义此自动化框架.

Could you please tell me how did you define this automation framework.

要验证原因在于您关联的测试方法中.请创建另外两个代码ui测试.然后将MTM中的案例与这三个代码ui测试相关联,然后重试.

To validate the cause is in the Test Method you associated. Please create another two code ui tests. Then associate the cases in MTM with these three code ui tests then try it again.

如果仍然存在相同的问题.我认为问题可能出在获取测试用例ID的定义上.

If still have the same problem. I think the problem is probably in the defination to get the test case id.

顺便说一句,请看一下下面的线程,它给出了一个使用以下示例获取测试用例ID的示例 TestContext . 属性 [ "__ Tfs_TestCaseId __"" ]. ToString ();

By the way, please take a look at the following thread and it give an example to get the test case id using TestContext.Properties["__Tfs_TestCaseId__"].ToString();

http://stackoverflow.com/questions/17995330/how-to-retrieve-the-id-of-the-workitem-that-started-an-automated-test/18272068#18272068

最好的问候,

肖湖


这篇关于在关联的自动化中访问MTM测试用例ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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