Forum Discussion

sinis's avatar
sinis
Contributor
7 months ago

TCUnit Test TestLog

 I am using TCUnitTest and the result will be logged into TestComplete when an exception occurs in Visual Studio. But I need to add a comment when the testcase is passed. Is it possible.

Now, we have the testlog like this. Whenever the test is passed, I need to log something as sub of TestCompleteUnitTests log. Is this possible?Or is it psossible to rename the log since it is created an ambiguity which testcase has passed and which has failed.

4 Replies

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Is your test unit data driven that is calling the same test function?

  • Have you tried using event handlers for this task?

     

     

    • sinis's avatar
      sinis
      Contributor

      rraghvani , I am calling the same TCUnit Test using a loop. I have just written a for loop to call TCUnitTest again and again.

      Henry1 ,No I havent tried events

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    You could use Log.Enabled Property to output your required message if a test pass or fails - use that in conjunction with your variable i.

     

    Also, you should try and use Camel case, when defining your functions e.g. GenericFunctionToWrite() - also the function name needs to be meaningful.