0

I recently added xxx.runsettings file to my solution to pass parameters from TFS variables to my solution(url). Now I'm not able to generate .trx result file after running TFS build in Test summary/results page, only code coverage is generated.

[.runsettings code taken from here-https://msdn.microsoft.com/en-us/library/jj635153.aspx

Can anyone here tell me how to edit the runsettings file in order to show .trx result file in my test summary instead of code coverage? TFS 2015 Update 3,TFS ms build

Can see this window once build is completed.

Run functional test Logs

Publish results log - Logs 2017-06-21T17:20:49.9138829Z Executing the powershell script: C:\agent\tasks\PublishTestResults\1.0.22\PublishTestResults.ps1

2017-06-21T17:20:50.0628925Z ##[warning]No test result files were found using search pattern 'C:\agent_work\2\s**\TestResults\xyz*.trx'.

4
  • Can you share the build logs? Commented Jun 21, 2017 at 0:48
  • sorry can't share entire log, do you want to see any specific task log? like VSTest Agent deploy,Run functional,publish result? Commented Jun 21, 2017 at 13:31
  • Yes, just logs for run functional and publish result. Commented Jun 22, 2017 at 0:24
  • @Eddie-MSFT pls find attached logs Commented Jun 22, 2017 at 16:19

2 Answers 2

0

Just remove <ResultsDirectory>.\TestResults</ResultsDirectory> section from the runsettings file should fix your issue.

By the way, Publish Test Result task does not work in your scenario since it can only publish the test result files on the build agent while the trx file is usually generated on the test agent with Run Functional Test task.

Sign up to request clarification or add additional context in comments.

4 Comments

thanks..now i'm getting trx file in TFS build result
can you tell me how to include my html report for UI automation to TFS build result? with the current configuration
@shenQA You'd like to upload it as attachment or want to show it in TFS?
Or better, instead of html(since I have trx result), just include screenshot of failed test cases to the result as attachment, using runsettings file?
0

Since you are running the VStest. Which will not generate the .trx result file.

VStest step is actually using VSTest.Console.exe command, it will use the /logger:TfsPublisher which not generate the .trx file. So if you use the built-in tasks such as Visual Studio Test or Run Functional Tests to run tests, results are automatically published and you do not need a separate publish test results task.

To log results into a Visual Studio Test Results File (TRX) use /Logger:trx. More details please refer this command. To generate a .trx file is not related to runsettings file.

For TFS , the test result is automatically published, you could click test run for more details.

4 Comments

I'm already using Publish Test Result in build and using VStest. After adding the .runsettings file, i'm unable to generate .trx result. I need .runsettings file to pass parameters to test from build, also generate .trx file. Any help?
@shenazshakeer VSTEST step is actually using VSTest.Console.exe command, it will use the /logger:TfsPublisher which not generate the .trx file. So if you use the built-in tasks such as Visual Studio Test or Run Functional Tests to run tests, results are automatically published and you do not need a separate publish test results task.
@shenQA You could take a look at this command msdn.microsoft.com/en-us/library/jj155796(v=vs.110).aspx. To log results into a Visual Studio Test Results File (TRX) use /Logger:trx. For tfs , the test result is automatically published, you could click test run for more details.
even without Publish test results,i'm not able to show .trx in TFS. I can see after the build "Results file at :./testresults/xxx.trx" but cannot see in my system, only .coverage instead of trx. I guess I need to edit .runsettings file to show trx instead of .coverage.Can you please tell me how to do that?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.