Storing TFS-IDs in testcases to use TFS API

Experiences, small talk, and other automation gossip.
bennylew
Certified Professional
Certified Professional
Posts: 22
Joined: Wed Sep 17, 2014 10:43 am

Storing TFS-IDs in testcases to use TFS API

Post by bennylew » Tue May 26, 2015 9:59 am

Hi,

i developed some peace of coded to report the results of Ranorex Testsuite to a Teamfoundation Server. For this scenario I need a mapping between a testcase in Ranorex and the testcase in TFS (work item id).

I did this in an easy way and put the TFS-ID in the title of the Ranorex testcase. I.E. this looks like "10865_Testcasename". After the testsuites finishes I pass the ActivityStack to my TFSReporter class an do the reporting.
This is not very comfortable if you have a data driven testcase with n iterations.

Do you have any ideas how to solve this problem? Another idea was to store the TFS-ID in a parameter of a testcase/Iteration.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Storing TFS-IDs in testcases to use TFS API

Post by Support Team » Thu May 28, 2015 5:16 pm

Hi bennylew,

I am afraid we are of little help here.
I can just provide a link to a resource which might be interesting for you.
Here is the link: HowTo: Test Automation with TFS and Ranorex.

Regards,
Markus
.
Image

bennylew
Certified Professional
Certified Professional
Posts: 22
Joined: Wed Sep 17, 2014 10:43 am

Re: Storing TFS-IDs in testcases to use TFS API

Post by bennylew » Wed Jun 03, 2015 8:10 am

Hi Markus,

thanks four your reply. We want to go both ways, the one you provided and my way, with the TFS api. In our Company there are some problems with the infrastructure that makes it difficult for us to implement your way.

Does your Team plan to offer Interfaces to different ALM tools (TFS, Jira, Rational) in the future?

Regards
Benjamin

log
Certified Professional
Certified Professional
Posts: 14
Joined: Tue Mar 24, 2015 6:28 am
Location: Sydney, Australia

Re: Storing TFS-IDs in testcases to use TFS API

Post by log » Thu Jun 04, 2015 4:04 am

Hi Benjamin,

It sounds like your TFSReporter class already has the ability to post test results for a TFS TestCase work item ID (that you extract from the Ranorex test case name) to a new test run in the TFS project, so that's a great start!

Have you tried using the ITestCaseResult.CreateIteration() method, msdn.microsoft.com/en-us/library/microsoft.teamfoundation.testmanagement.client.itestcaseresult.createiteration.aspx, to create a new instance of an ITestIterationResult for each of the n iterations and add it to the ITestCaseResult instance before it is saved?

There's a code snippet in this article that may be useful: vivekbansod.blogspot.com.au/2013/06/create-test-case-step-result-using-tfs.html.

Some other TFS API snippets: blogs.msdn.com/b/aseemb/archive/2012/08/07/code-snippets-on-test-management-apis.aspx

Sorry for the format of the URLs in my post, I cannot post URLs yet since my account is new.

Hope this helps,
Gabriel