Forum Discussion

TCU100's avatar
TCU100
Occasional Contributor
5 years ago

Exec TestComplete Tests using Azure pipeline, and get test results as attachment for each test

  Hi,  I am running TestComplete Tests using Azure pipeline, I only get .mht file as attachment when a test fails. How can I get all .mht files for each test as attachment ? Tried steps as m...
  • hkim5's avatar
    hkim5
    5 years ago

    I understand how that could seem counter-intuitive. The simple green poriton of the pie chart for the tests that passed does seem like it doesn't carry too much information. However, the workaround mentioned above does work, as I have tested it out. 

    Attached are the following:

    1) OnStopEvent : for creating mht files after the completion of every test case in your project, and saving them into a desired location (you can add event handlers by going to the project level, right click add item, event handler)1.11.2

    2) Delete old mht files script: so that if your test cases in your project ends up having different names, you aren't publishing irrelevent mht files for a subsequent build (possibly cluttering it with lots of old mht's)

    2

    3) Publish Artifact directory path - this is really up to you and how your workflow is... I pull my test cases from git, and the mhts from (1) gets stored within $(Build.Directory.LocalPath)\TestProject1\MHT_Files - so i point it that way. you can look up predefined variables like Build.Directory in the microsoft azure devops documentations page. 

    3.13.2

    4) Artifacts & the mht files for the passed test cases. 

    4.14.24.3

    hope this helped :)