TFS REST API:测试用例步骤,参数和参数值数据获取 [英] TFS REST API: Test Case Step, Parameter and Parameter values data fetch

查看:89
本文介绍了TFS REST API:测试用例步骤,参数和参数值数据获取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

附上具有3个步骤的测试用例的屏幕截图以及具有动作结果的2个步骤。两个参数及其值。



Attached the screen shot of the test case having 3 steps along with 2 steps with action result. two parameter along with their values.




我使用了以下获取工作项REST API来获取此测试用例数据:

I have used following get work item REST API to fetch this test case data:

http://< host> ;:8080 / tfs / DefaultCollection / _apis / wit / workitems?ids =< WI Id>& $ expand = all& api-version = 1.0

http://<host>:8080/tfs/DefaultCollection/_apis/wit/workitems?ids=<WI Id>&$expand=all&api-version=1.0

使用get work获取上述测试用例时item rest API。 响应保存步骤,参数和参数值,如下所示:

When fetching above test case using the get work item rest API.  response holds the steps , parameter and parameter values as per following

" Microsoft.VSTS.TCM 。步骤":  "< DIV>< DIV>< P>步骤操作1< BR />< / P>< / DIV>< / DIV>< DIV> ;< P>& nbsp; Step1 Result1< / P>< / DIV>< DIV>< DIV>< P>步骤
Action2< BR />< / P>< ; / DIV>< / DIV>< DIV>< P>& nbsp; Step2 Result2< / P>< / DIV>步骤Action3< P>& nbsp;< / P>< P> & nbsp;< / P>< DIV>< DIV>< P> @ parameter1< BR />< / P>< / DIV>< / DIV>< DIV>参数
1结果< BR />< P>& nbsp;< / P>< / DIV>< DIV>< P> @ parameter2< / P>< / DIV>< DIV> ;参数2结果< P>& nbsp;< / P>< / DIV>"





" Microsoft.VSTS.TCM.Parameters" :""



$
" Microsoft.VSTS.TCM .LocalDataSource":"
v1a1v2a2v3 "



$
这里我关注的是微软的价值回报。 VSTS.TCM.Steps,Microsoft.VSTS.TCM.Parameters,  Microsoft.VSTS.TCM.LocalDataSource字段。



1)对于Microsoft.VSTS.TCM.Steps:值即将到来,但不是格式这样我们就可以确定哪个是step1,step2,step3及其相应的动作结果。


 

"Microsoft.VSTS.TCM.Steps":  "<DIV><DIV><P>Step Action1 <BR/></P></DIV></DIV><DIV><P>&nbsp;Step1 Result1</P></DIV><DIV><DIV><P>Step Action2 <BR/></P></DIV></DIV><DIV><P>&nbsp;Step2 Result2</P></DIV>Step Action3<P>&nbsp;</P><P>&nbsp;</P><DIV><DIV><P>@parameter1 <BR/></P></DIV></DIV><DIV>parameter 1 result<BR/><P>&nbsp;</P></DIV><DIV><P>@parameter2</P></DIV><DIV>parameter 2 result<P>&nbsp;</P></DIV>"


"Microsoft.VSTS.TCM.Parameters": ""


"Microsoft.VSTS.TCM.LocalDataSource": " v1a1v2a2v3"


Here my concern is for the value return for the Microsoft.VSTS.TCM.Steps ,Microsoft.VSTS.TCM.Parameters,  Microsoft.VSTS.TCM.LocalDataSource fields.

1) For Microsoft.VSTS.TCM.Steps : value coming but not in the format such that we can identify which is the step1, step2 , step 3 and their corresponding action result.
 

格式不是每个步骤的一致性,可以解析查找每个步骤数据(步骤操作和步骤操作)结果)在此响应中,您可以看到步骤1 /步骤2 HTML标记和步骤操作3 HTML标记之间的区别。同样不同的
参数格式。

Format is not the consistent for each steps such that can be parse to find the each step data (Step action and step action result) here in this response you can see difference between the step 1/ step2 HTML tag and step action 3 HTML Tag. similarly different format for the parameter.

< DIV>< DIV>< P>步骤Action1< BR />< / P>< / DIV>< ; / DIV>

< DIV>< P>& nbsp; Step1 Result1< / P>< / DIV>

< DIV>< DIV> ;< P>步骤动作2< BR />< / P>< / DIV>< / DIV>

< DIV>< P>& nbsp; Step2 Result2< ; / P>< / DIV>

步骤操作3< P>& nbsp;< / P>< P>& nbsp;< / P>

< DIV>< DIV>< P> @ parameter1< BR />< / P>< / DIV>< / DIV>

< DIV>参数1结果< BR />< P>& nbsp;< / P>< / DIV>

< DIV>< P> @ parameter2< / P>< / DIV>

< DIV>参数2结果< P>& nbsp;< / P>< / DIV>

<DIV><DIV><P>Step Action1 <BR/></P></DIV></DIV>
<DIV><P>&nbsp;Step1 Result1</P></DIV>
<DIV><DIV><P>Step Action2 <BR/></P></DIV></DIV>
<DIV><P>&nbsp;Step2 Result2</P></DIV>
Step Action3<P>&nbsp;</P><P>&nbsp;</P>
<DIV><DIV><P>@parameter1 <BR/></P></DIV></DIV>
<DIV>parameter 1 result<BR/><P>&nbsp;</P></DIV>
<DIV><P>@parameter2</P></DIV>
<DIV>parameter 2 result<P>&nbsp;</P></DIV>

  问题:这是已知的问题。或者我们有什么办法可以使用REST API以一致的格式获取步骤数据




2)Microsoft.VSTS.TCM .Parameters:即使参数仍然响应的测试用例没有参数值。

问题:这是否已知问题。或者有没有办法使用REST API获取参数字段数据。





3)Microsoft.VSTS.TCM.LocalDataSource或参数值:值作为响应的一部分,但采用的格式很难识别哪个值属于 哪个参数。这里v3属于步骤参数2但不能从响应中区分


问题:这是一个众所周知的问题。或者有没有办法通过参数名称使用REST API.ie列出参数明智值获取参数值。



请回答这些问题,这将是很好的尽快回复。



提前致谢。



$




 Question: Is this already known issue. or is there any way we can get steps data in consistent format using REST API


2 )Microsoft.VSTS.TCM.Parameters: even though the test case having parameter still response not having value for the parameter.
Question: Is this already known issue. or is there any way to get parameter field data using REST API.


3) Microsoft.VSTS.TCM.LocalDataSource or parameter values : value coming as part of response but is in the format which is difficult to identify which value belongs to  which parameter. here v3 belong to step parameter 2 but not able distinguished from response.
Question : Is this already known issue. or is there any way to get parameter values by parameter name using REST API.i.e list parameter wise values.

Kindly reply to these questions, It will be great to have response as soon as possible.

Thanks in advance.




推荐答案

你好Aresha,



你能否确认一下,你在做什么? "单元测试"或"手动测试"? 



我建议你,参考以下链接:

https://www.visualstudio.com/en-us/docs/integrate/api / test / cases



您是否检查过以下链接:
https://www.visualstudio.com/en-us/docs/work/track/build-test-integration
,你可能会得到一些信息。 



问候,

Swikruti

Hello Aresha,

Could you please confirm, are you working with "Unit Testing" or "Manual Testing" ? 

I would suggest you, refer the below link:
https://www.visualstudio.com/en-us/docs/integrate/api/test/cases

Have you checked this link: https://www.visualstudio.com/en-us/docs/work/track/build-test-integration, you might get some information. 

Regards,
Swikruti



这篇关于TFS REST API:测试用例步骤,参数和参数值数据获取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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