Forum Discussion

balinta01's avatar
balinta01
Occasional Contributor
13 years ago

Job's tasks cannot be performed on slaves

Hi all!



I have two different jobs on slave computers which consist of different tasks and I call these tasks as keyword tests (run test) in a keyword test. In this case I suppose(?) there is not simultaniously executed tasks, since I run a task from a job instead of running the job. Somehow the test fails in the middle of the whole test when they are on two slaves with the error message of "Cannot perform this operation when the Job1 is running". I havent got this message when they were on master and slave computers. What might the problem be?



Regards,

Attila

1 Reply

  • Hi,


    It looks like the problem is that the test engine does not finish the execution of one job (that the first task belongs to) and tries to start running another task that belongs to the second job. As the jobs can be executed one after another in turn, the error occurs.


    To solve the problem, you need to delay the test execution between running the tasks. To do this, you can use the WaitForState method. For example:

    function Test()

    {

      NetworkSuite.Jobs.Items(0).Tasks.ItemByName("Task1");

      NetworkSuite.Jobs.Items(0).WaitForState(ns_Idle);

      NetworkSuite.Jobs.Items(1).Tasks.ItemByName("Task2");

    }


    To call the method from a keyword test, you can use the Run Code Snippet operation.