I have developed a MS Test project for writing unit tests. In a test method which runs for long time, I want to print the current status to the standard output

Sateesh Kumar 1 Reputation point
2023-07-13T10:41:33.3166667+00:00

I have developed an MS Test project for writing unit tests. In a test method which runs for long time, I want to print the current status to the standard output. I tried Console.Writeline(), TestContext.Writeline(), Trace.Writeline() functions but the statements are printed after completion of test method and not during the execution of test method. What is the solution for printing statements during execution of a test method?

Microsoft Teams | Development
Microsoft Teams | Microsoft Teams for business | Other
{count} votes

1 answer

Sort by: Most helpful
  1. SokiGuo-MSFT 31,536 Reputation points Microsoft External Staff
    2023-07-14T07:28:33.37+00:00

    Hi @Sateesh Kumar

    Thanks for visiting our forum. Microsoft Teams tag is mainly focused on the general issue of Microsoft Teams application troubleshooting. According to your description, your problem is related to Ms Test, which we are not very familiar. The following suggestion is just for your reference. Thanks for your understanding!


    Here is a similar thread you can refer to:

    https://stackoverflow.com/questions/4884043/how-to-write-to-console-out-during-execution-of-an-mstest-test

    Hope this helps!


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.