locked
Coded UI : Test result from trx to customized html RRS feed

  • Question

  • Hi,

    I've query realted to customized test result generation,

    I am getting trx file after executing test script using command line.

    I've few more queries :

    1. How to process this trx file to get html report and if any TC failed than how to get screenshot for failed steps?

    (How to show all this in customized test result)

    2. I've single solution file, where all the scenarios are automated so it give me single dll, is there any way to get the dll for folder wise? I mean, if login is one flow and have all the TC's automated under Login folder than how to get dll for "Login" folder.


    Thanks & Regards,

    Sunil


    Best Regards, Sunil Email: sunil.pandey@techendeavour.com

    Wednesday, September 3, 2014 11:36 AM

Answers

  • You need to use custom tool or create your own,

    http://trx2html.codeplex.com/

    http://sourceforge.net/projects/trx-to-html/

    If you use VSTest.Console.exe to run your test from the command line, you can use the the following to collect screenshot or any other data

    /Settings:[ file name ]
    Run tests with additional settings such as data collectors.

    More info:

    http://msdn.microsoft.com/en-us/library/jj155796.aspx


    Visual Studio ALM MVP | ALM Consultant
    Blog | MSDN | Stackoverflow | Twitter | YouTube | CodePlex | TFSEG | MEA-ALM| LinkedIn
     
     

    • Marked as answer by Amanda Zhu Friday, September 12, 2014 1:49 AM
    Wednesday, September 3, 2014 3:16 PM
  • Hi Sunil054,

    Thank you for your information. I have to say that we can’t have the test project dll into a folder under the project directory. Project dll is always compiled into bin\debug folder.

    You can reference this document: Specifying Test Settings for Visual Studio Tests to know how to use test settings file. You can enable Screen and Voice Recorder data collector in test settings to get screen video for the test run.

    But based on this requirement: reason of test failed, where hyper link is provided which leads to failed screenshot , enabling Screen and Voice Recorder data collector in test settings is not able to get it. For a screenshot on each step even failed step, you can get the screenshot from Coded UI test html log, please see: Analyzing Coded UI Tests Using Coded UI Test Logs , but there is no hyperlink to lead to the failed screenshot in the html log.

    Only the first three requirements can be generated in .trx file. If you want all requirements in a test report, you have to customize this test report yourself to combine .trx file and html log, moreover if you want that hyperlink in your final report, you need write code to accomplish it in the report.

    Best regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Proposed as answer by Amanda Zhu Wednesday, September 10, 2014 2:24 AM
    • Marked as answer by Amanda Zhu Friday, September 12, 2014 1:49 AM
    Friday, September 5, 2014 5:29 AM

All replies

  • You need to use custom tool or create your own,

    http://trx2html.codeplex.com/

    http://sourceforge.net/projects/trx-to-html/

    If you use VSTest.Console.exe to run your test from the command line, you can use the the following to collect screenshot or any other data

    /Settings:[ file name ]
    Run tests with additional settings such as data collectors.

    More info:

    http://msdn.microsoft.com/en-us/library/jj155796.aspx


    Visual Studio ALM MVP | ALM Consultant
    Blog | MSDN | Stackoverflow | Twitter | YouTube | CodePlex | TFSEG | MEA-ALM| LinkedIn
     
     

    • Marked as answer by Amanda Zhu Friday, September 12, 2014 1:49 AM
    Wednesday, September 3, 2014 3:16 PM
  • Hi Sunil054,

    You can convert .trx file to html based on M.Radwan’s suggestion. Using Test Settings file with test run will generate a separate file for screenshot if you enable Screen and Voice Recorder data collector in test settings, it won’t be included in .trx file.

    For your another question, could you describe your question in details? One test project is compiled into a dll. The test project dll is under bin\debug folder.

    You have multiple test projects in the solution, right? The test method Login is in the separate test project, right? What did you mean that ‘get the dll for folder wise’?  Why did you want to do it?

    Best regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, September 4, 2014 9:36 AM
  • Hi,

    Actually I've single project where all the scenarios are automated, day log-in is one requirement, I've one folder in project so my question is : "Is it possible to get the dll for this log-in folder" ?

    Regarding screenshot : In my script under "TestInitialize" I am enabling screenshot only for errors:

    Playback.PlaybackSettings.LoggerOverrideState = HtmlLoggerState.ErrorAndWarningOnlySnapshot;

    So while running the script using console, how to use testsetting (/Settings:[ file name ])

    (I've gone through the link provided but not sure how to use it)

    I am confused about testsetting file, can you please explain?(How to create and use?)

    My expectation is at the end I should have a test report containing:

    - no of test method executed ,

    - no of  test method passed,

    - no of test method failed

    - reason of test failed, where hyper link is provided which leads to failed screenshot

    - Every test method logs what all steps performed and passed



    Best Regards, Sunil Email: sunil.pandey@techendeavour.com

    Thursday, September 4, 2014 1:02 PM
  • Hi Sunil054,

    Thank you for your information. I have to say that we can’t have the test project dll into a folder under the project directory. Project dll is always compiled into bin\debug folder.

    You can reference this document: Specifying Test Settings for Visual Studio Tests to know how to use test settings file. You can enable Screen and Voice Recorder data collector in test settings to get screen video for the test run.

    But based on this requirement: reason of test failed, where hyper link is provided which leads to failed screenshot , enabling Screen and Voice Recorder data collector in test settings is not able to get it. For a screenshot on each step even failed step, you can get the screenshot from Coded UI test html log, please see: Analyzing Coded UI Tests Using Coded UI Test Logs , but there is no hyperlink to lead to the failed screenshot in the html log.

    Only the first three requirements can be generated in .trx file. If you want all requirements in a test report, you have to customize this test report yourself to combine .trx file and html log, moreover if you want that hyperlink in your final report, you need write code to accomplish it in the report.

    Best regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Proposed as answer by Amanda Zhu Wednesday, September 10, 2014 2:24 AM
    • Marked as answer by Amanda Zhu Friday, September 12, 2014 1:49 AM
    Friday, September 5, 2014 5:29 AM