locked
TFS api how to save test results to the current test run RRS feed

  • Question

  • Hi, I'm writing an execution engine invoked by a TFS test case. I'm hoping to find a way to upload results to the current test run, at runtime. I haven't been able to find any documentation that accesses test run info at runtime? Is there a way to do that in TFS? Thanks,
    Friday, February 18, 2011 2:53 PM

Answers

All replies

  • Hi Hui Shi,

     

    Thanks for your post.

     

    In order to resolve this issue, I want to confirm some information with you:

    1        Could please provide the detailed steps information or example to explant your purpose?

    2        What’s the version of your TFS?

    3        Do you run the Test Case in Test Manager 2010?   


    John Qiao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, February 21, 2011 5:48 AM
    Moderator
  • Hi John,

    Thanks for the reply. Answers to questions below:

    1. Run an automated test case in Test Manager 2010. The test case calls an execution engine that eventually saves image results in a folder, in addition to text results logged to console. The execution engine needs to upload the results to TFS. Text results logged to console are automatically uploaded to TFS, but not the image results. Looks like there're Test Case Management APIs for creating and uploading attachment: IAttachmentOwner.CreateAttachment(filePath) and IAttachmentCollection.Add("0"). But I can't find how to associate the attachments with the current run. If that's not possible, is there a way to associate attachments with a certain test run? Thanks,

    2. VSTS 2010 TFS

    3. Yes

    Monday, February 21, 2011 7:22 AM
  • Hi Hui Shi,

     

    Thanks for your reply.

     

    According your reply, I think this issue is related to Microsoft Test Manager, so I suggest you to post it at http://social.msdn.microsoft.com/Forums/en-US/vsmantest/ for quicker and better response, where MTM experts live in.


    John Qiao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, February 21, 2011 7:29 AM
    Moderator
  • I don't know if this helps you, but you can use the method I described here: TFS automatic builds: How to add additional attachments in a test run

    Cheers

    • Proposed as answer by Sorin Serban Friday, June 8, 2012 1:28 PM
    Friday, June 8, 2012 1:28 PM