Synchronizing test runs on several workstations

Sometimes, there arises a need to synchronize tests launches from various projects to have specific actions executed at the same time. Usually, it is necessary when we perform concurrent testing or testing workflows which require simultaneous actions of multiple users.

To this end, synch points are applied, which will be thoroughly dealt with in this recipe.

How to do it...

To synchronize tests on several Slave computers, we need to perform the following steps:

  1. Expand the NetworkSuite element, right-click on the SynchPoints element, and opt for the Add | New Item... option.
  2. In the opened Create Project Item window, enter the name of the synch point (for example, MyPoint), and click on OK.
    How to do it...
  3. Repeat the steps for all the projects that needs to be synchronized.
  4. Now, add the following code in the code earmarked for synching:
    NetworkSuite.Synchronize("MyPoint");

How it works...

At the point of distributed tests launch, when reaching the synching points, the tests will pause; continuation of the tests will take place only after all the tasks have reached the synch point.

In the case that a project contains a synch point, and at least one of the projects fails to evoke the NetworkSuite.Synchronize method, this would lead to script hang-ups, as the scripts would be waiting for all the projects to reach the synch point in view. In this case we will have to stop test execution manually.

This is why it is recommended that we attentively follow through the NetworkSuite.Synchronize invocation, if the project contains synch points.

See also

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

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