Using a Master workstation to run tests

TestComplete does not allow adding a Master computer to the hosts listing (thus, using the same as a Slave computer); however, the possibility to launch and run tests on the Master computer is still there.

How to do it...

To launch the tests simultaneously on the Slave and Master computers, it is necessary to go about the following steps:

  1. Start a job on the Slave computer:
    NetworkSuite.Jobs.ItemByName("Job1").Run(false);
  2. Then launch the tests on the local computer:
    test1();
    test2();
    
    testN();
  3. Finally, wait for the tests to complete on all the Slave computers:
    NetworkSuite.WaitForState(ns_Idle);

How it works...

The only parameter of the Run method is the WaitForCompletion parameter that is preset to the value of False, which allows launching the tests on the Slave computers and carries on with the script's execution.

Further on, we launch any tests locally, after which using the NetworkSuite.WaitForState method we wait for the script's execution to come through on all the Slave computers. Without this method's invocation, execution of the tests on the Slave computers will terminate, if the execution on the Master computer completes beforehand.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.202.27