Forum Discussion

bduncan's avatar
bduncan
Contributor
9 years ago

Class instantiation using vbScript

So far, I'm not loving TestComplete 11.  I created classes which have worked perfectly in TestComplete 7, and 10.  Now that I've upgraded to TestComplete 11, the instantiation of the classes work fine for a while, then they simply stop working and once that happens, they don't work again.

 

For example:

I have a unit, Testlogging.svb

Inside this unit is the class definition:

Class TestLog

   ...Private Variables

   ...Methods

   ...Properties

End Class

 

Also in the unit is the helper:

Function New_TestLog()

     Set New_TestLog = New TestLog

End Function

 

In my test scripts I include the unit with 'USEUNIT TestLogging and when I want to create a new instance I make the call as follows:

Dim MyLog: Set MyLog = New_TestLog()

 

This has worked since it was written in TestComplete 7 and was working fine even in TestComplete 11 until the this morning when I went to run a script and got the error:

Object doesn't support this property or method: 'TestLogging.New_TestLog'

 

In the unit where the call is made, I can use Ctrl+Click on New_TestLog and it takes me to the procedure so the reference is not the problem.  I tried fully qualifying the call with Set MyLog = TestLogging.New_TestLog but that fails as well with the same message.  If I put a breakpoint on the call that fails to step into it, then run the test what happens is without stopping at the breakpoint, I get the same error.  If I put a breakpoint on the last executable line BEFORE the call, same issue.  Note that breakpoints in every other location had been working fine.

 

While I was writing this, I tried again to run the code without making any changes and now it works.  For how long, I have no idea.

 

Has anyone else had any problems with this?

 

 

Thanks

Bill

 

 

2 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi Bill,

     

    Unfortunately, I have no good explanation, but, just to be on the safe side and because you mentioned that it "was working fine even in TestComplete 11 until the this morning" - I believe that you restarted TestComplete and, maybe, even your computer?

    If the problem persists, I would recommend to contact Support via the http://support.smartbear.com/message/?prod=TestComplete form - they might ask you to collect some additional information using the ReportGenerator tool (provided with TestComplete) when you experiense the problem or do some other actions.

    • bduncan's avatar
      bduncan
      Contributor

      So far, I have had no further insidences of this problem.  I am hopeful that whatever was causing the issue has been rectified, although but what means, I don't know.