Pre-launch Nodes API

The Pre-launch Nodes API can be used to launch specific test environments before your selenium test script runs. Typically you call the API early in your build process like during unit testing or while your test environment is being setup so you can get a head start launching grid nodes that you need for your selenium tests.

The auto scaling process reacts to requests made to the hub by your running selenium test scripts and launches grid nodes to fulfill the current need. The pre-launch API is independent from the auto scaling process in the sense that requested nodes will be launched to reach a desired state rather then acting upon real time test requests.

A pre-launch API request discounts nodes requested if they are already registered with the hub server and not busy processing tests. Example: if 5 internet explorer v10 windows 8 nodes are requested and 2 such nodes already are registered with the hub and are idle, only 3 nodes will be launched.

The launched nodes are not tied to any specific test run but will register with the hub and start processing requests from the test queue immediately upon registering and are also handled by the auto scaling functionality and automatically scaled down when not used anymore like any other node.

Also, nodes that are being launched but have not yet registered with the hub are also considered idle so that the API can be executed many times in a short period of time without causing many duplicate test environments to be launched.

The typical scenario for this is when the API is used to prepare your selenium grid while your build server is executing unit tests or test VM's are being prepared and there is an execution halt in one of these tasks and the script needs to be run again shortly after first execution. In this case the request will not be duplicated.

You need to provide the selenium grid hub username and hub password in order to execute a request. You can either execute this API manually via a browser or build your own program function calling this API when needed.


Example

This example will launch 5 internet explorer v10 windows 8 nodes and 5 firefox v23 windows 7 nodes and 5 linux nodes. Specify as many environments as you like using the format shown below:

http://your_subdomain.gridlastic.com/preset?&
browserName1=iexplorer&browserVersion1=10&platform1=win8&nodes1=5&
browserName2=firefox&browserVersion2=23&platform2=vista&nodes2=5&
browserName3=firefox&browserVersion3=32&platform3=linux&nodes3=5