Forum Discussion

kchoudhury's avatar
kchoudhury
Contributor
13 years ago

How do i run tests simulataneously in 1master and 1 slave?

I have 2 systems , both have testexecute license. How to configure the network suite such that i can run tests simulataneously in the master as well as the slave. If i add test items in the master project for e.g  Test1(a local script) and next test item job1(which is a slave project script) . It first completes Test1 and only then it starts job1 .



I want that job 1 and test1 start simultaneously please help.


1 Reply

  • Julia_K's avatar
    Julia_K
    SmartBear Alumni (Retired)

    Hello Kaushik,


    To accomplish your task, you can create a test that starts a job on the slave computer using the Job.Run method with the WaitForCompletion parameter set to false (so that TestComplete does not wait until the job execution is over) and then, starts the needed test on the master computer.


    For example, the sample script below launches Jobs1 on the slave computer and the Test1 script routine on the master computer:



    function MainTest()

    {

      // Runs Job1 on your slave computer

      NetworkSuite.Jobs.ItemByName("Job1").Run(false);



      // Runs the Test1 routine on your master computer

      Test1();



      // Waits until all the tasks of Job1 are executed

      NetworkSuite.WaitForState(ns_Idle);

    }


    Note that you need to call the NetworkSuite.WaitForState method with the ns_Idle parameter at the end of the master script for TestComplete to wait for all the tasks of Job1 to be executed. Otherwise, if the script execution on the master computer finishes earlier than on the remote computers, the remote tests execution will be interrupted upon the end of the master script and an error will occur.


    To control the tests more efficiently, you can also use different means of synchronization provided by TestComplete for distributed tests - for example, synchronization points. For more information on the distributed test synchronization, please see the Synchronizing Projects - Overview Help topic.


    Please let us know if you have any additional questions.

    Thank you.