Forum Discussion

mattc_1's avatar
mattc_1
Occasional Contributor
15 years ago

ItcIntegration Return Log / Error

I am using a separate application to make calls to Test Complete using the TesetComplete Comm dll. My application calls individual functions such as setting a controls value one at a time using the same function being called my my app.



Originally I was using On Error Resume Next but, the log in Test Complete will log it but I am wanting my external app to display the error or even show that I have an error. As far as I now the only way to even know that I have an error is using GetLastResultDescription which returns what and where it happened but not why.



I removed the On Error Resume Next and it allows the application to catch the Errors in some cases but in others Test Complete seems to log the error in it's log and eat the Raise Error portion that goes up to my app.



Is there anyway to either have the error message raised to my app or is there a way to view a specific log from my external app?



Viewing a specific log is probably the best way to go in my opinion.

1 Reply

  • Hi Matthew,


    As far as I understand, you are using a Connected application, and this application is working with the Integration object which provides access to the TestComplete COM model. In the Connected application, you need to catch error messages posted to the TestComplete log. If my understanding is correct, you can use the following approach:

    1. In TestComplete, create an event handler for the OnLogError event (see the "OnLogError Event" help topic ( http://www.automatedqa.com/support/viewarticle.aspx?aid=3796 ) for more information). This event handler will be used as a wrapper which will execute your C# code.

    2. Create a new class in your C# code.

    3. Add a method which will handle the messages to the class.

    4. Create an instance of the class.

    5. Use the approach described in the "Creating Scripting Objects From Application Objects" ( http://www.automatedqa.com/support/viewarticle.aspx?aid=8050 ) help topic to make the C# object available in your TestComplete script.

    6. In the OnLogError event handler, add the corresponding script code which will call the needed method of your C# object and pass the data you need to the object. This will allow you to handle the TestComplete event in your C# code.