Forum Discussion
Abramova
13 years agoStaff
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.