Methods and options (including the one letter shorthands) are the same when using as a Node module, however a more verbose version of both commands (methods) and options (parameters) are available and encouraged to use for code clarity.

Batch command is available as command line only and loads a batch file containing one WebPageTest CLI command with options per line. It runs all commands in paralell but returns and array of results in order as they appear in the batch file once all results are ready. The exit status code is the sum of all individual commands exit status code.

By running

$ webpagetest batch commands.txt

where commands.txt contains:

test twitter.com/marcelduran --first --location foo

test twitter.com/marcelduran --first --location bar

It schedules the 2 tests above returning an array of size 2 in the same order as in commands.txt file:

[

{

"statusCode":200,"statusText":"Ok",

"data":{

"testId":"130715_AB_C1D",

...

}

},

{

"statusCode":200,"statusText":"Ok",

"data":{

"testId":"130715_CD_E2F",

...

}

}

]

With exit status 0 in case none of commands returns an error:

$ echo $?

0

By running multiple sync tests, i.e. with either --poll or --wait, all tests are schedule and results are pulled or wait in paralell, it means if tests are set to run in different locations of same location with multiple agents, the final result might come together but the result array will only return once all tests are done. e.g.: