ITestCaseResult.Iterations.Count返回0与迭代测试

编程入门 行业动态 更新时间:2024-10-28 21:15:53
本文介绍了ITestCaseResult.Iterations.Count返回0与迭代测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有几个使用数据源的简单的网络测试。每个Web测试仅包含一个请求。

I have a couple of simple web tests that use data sources. Each web test contains only one request.

在它的pretty的防不胜防为什么他们失败了,因为他们有相当多的(80),每个人都有一个行数是1和150之间变化。

After they run it's pretty hard to detect why they failed, given that they are quite a few (80) and each has a number of rows that varies between 1 and 150.

所以,我用了TFS SDK以编程方式访问的结果,在发布TFS测试结果为构建之后。

Therefore, I used the TFS SDK to access the results programmatically, after publishing the test results to a build in TFS.

这里是code中的相关部分:

Here is the relevant part of the code:

foreach (var testRun in testRuns) { Console.WriteLine(string.Format("{0}", testRun.Title)); ITestCaseResultCollection testCases = testRun.QueryResults(); foreach (ITestCaseResult testcase in testCases) { Console.WriteLine(string.Format("{0}: {1}", testcase.TestCaseTitle, testcase.Outcome)); if (TestOutcome.Passed != testcase.Outcome) { Console.WriteLine(string.Format("\tNumber of iterations: {0}", testcase.Iterations.Count)); foreach (ITestIterationResult iteration in testcase.Iterations) { Console.WriteLine(string.Format("\t{0}: {1}", iteration.IterationId, iteration.Outcome)); } } } }

问题是,testcase.Iterations.Count始终为0。一切是正确显示。如果我打开从Visual Studio的测试结果,我可以看到的迭代和每个细节。

The problem is that testcase.Iterations.Count is always 0. Everything else is displayed correctly. If I open the test results from Visual Studio, I can see the iterations and the details for each.

我在想什么?

感谢。

推荐答案

调查多一点,我意识到我一直在寻找在错误的地方后。

After investigating a bit more I realized I was looking in the wrong place.

我感兴趣的是让细节所有数据绑定测试针对运行中的行,而ITestCaseResult.Iterations点有一定的测试用例中定义的迭代。

What I'm interested in is to get the details for all the rows that a databound test is running against, while ITestCaseResult.Iterations points to the iterations defined for a certain test case.

我感兴趣的是检索访问的测试用例结果附件中的信息:

The information I'm interested in is retrieved by accessing the attachments of a test case result:

foreach (ITestAttachment att in testCaseResult.Attachments) { Console.WriteLine(string.Format("{0}\t{1}", att.Name, att.AttachmentType)); }

尤其是那些具有这些类型: TmiTestResultDetail TmiTestRunReverseDeploymentFiles

especially the ones with these types: TmiTestResultDetail TmiTestRunReverseDeploymentFiles

如何提取这些附件的信息,构成了不同的问题。 :)

How to extract the information in these attachments constitutes a different question. :)

更多推荐

ITestCaseResult.Iterations.Count返回0与迭代测试

本文发布于:2023-10-28 16:22:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1537157.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:迭代   测试   ITestCaseResult   Iterations   Count

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!