Forum Discussion

Lagencie's avatar
Lagencie
Frequent Contributor
6 years ago

clr_bridge System.Threading does not work

Hello,

 

I have added the CLR Bridge System.Threading and want to call the function ManualResetEvent, but it keeps saying "RuntimeError: The specified object is not callable."

 

Here is the code i run:

EventTestComplete = dotNET.System_Threading.ManualResetEvent(False)

The code works in normal pycharm call with 

 

from System.Threading import ManualResetEvent, Timeout, Thread
EventTestComplete = ManualResetEvent(False)


Any ideas why this error pops up in Testcomplete all the time, but works in pycharm?

  • Hi Dominik,

    I see that you have contacted the Support Team on this issue. Let me quote their reply here:


    Support Team wrote:

    Thank you for reaching out to us. TestComplete adds a special method for .NET class constructors, zctor - see the "Calling Functions From .NET Assemblies" article for more details. Thus, the object should be created like this: 
    EventTestComplete = dotNET.System_Threading.ManualResetEvent.zctor(False)

    Please also note that TestComplete does not support multithreaded scripts, so porting code from PyCharm might not work if it involves multithreading.


     

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Dominik,

    I see that you have contacted the Support Team on this issue. Let me quote their reply here:


    Support Team wrote:

    Thank you for reaching out to us. TestComplete adds a special method for .NET class constructors, zctor - see the "Calling Functions From .NET Assemblies" article for more details. Thus, the object should be created like this: 
    EventTestComplete = dotNET.System_Threading.ManualResetEvent.zctor(False)

    Please also note that TestComplete does not support multithreaded scripts, so porting code from PyCharm might not work if it involves multithreading.


     

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    TestComplete automation is not multi-threaded.  It's entirely possible that the reason why this can't work is for that simple reason.