我有几个使用数据源的简单的网络测试。每个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与迭代测试
发布评论