Forum Discussion

giovanni's avatar
giovanni
Occasional Contributor
9 years ago

Detaching events in remote tests

Is it possible to detach an event in a test running on a remote host?

More precisely: 

- I'm using OnNetVarChange event to trigger some event on slave project

- The event handler should be called only by master project

 

I ve added the command Event.EventName.DetachFromTestComplete() at beginning of slave routine, but apparently it does not prevent the event handler to be executed on the slave.

 

I'm using TestComplete v11.30 , Python script.

 

 

Best Regards, 

Giovanni

6 Replies

  • giovanni's avatar
    giovanni
    Occasional Contributor

    I also have another issue:

     

    I'm running this project on  two hosts (+ a master).  I'm getting the following error message:

     

    Runtime Error

    Failed to invoke an object. Reason: timeout expired.

     

    The same error occurred on the two hosts, probably because they are not able to change two (different) NetworkSuite variables.

     

    Could that be caused by the fact that I'm not able to detach the event handler in the hosts, and every time master or hosts modify a NetworkSuite vaiable the calback are called toghether?

     

    Any suggestions?

     

    Many thanks,

    Giovanni 

     

     

    • giovanni's avatar
      giovanni
      Occasional Contributor

      I've solved the Runtime Error by including all NetworkSuite variable assignments in critical sections.

       

      I still don't manage to detach the EventHandler ... 

       

       

      Regards, 

      Giovanni

      • m_essaid's avatar
        m_essaid
        Valued Contributor

        Hi,

        not sure to figure it out.

        if you call a routine by another one, just use a parameter for the master routine that is set to a default value for all the others routines.

        if you call TestExecute, it's the same, but with a command-line parameter.

        Mehdi