JMeter is of course a performance test tool (see here) but it can also be put to good use for various automation tasks. For example, I sometimes use it to drive ssh through an Apache instance to gather server metrics, allowing easy graphing of CPU, gc stats etc. In this case I'm using it to drive the webPageTest API, to send down test scripts, poll for test status, analyse results and build data files for Jenkins graphs.
There are three stages to the jmeter script:
1. Kick off the webPageTest test run
2. Wait for the webPageTest to complete
3. Retrieve the results and analyse them
It's worth discussing input data briefly as well, particularly for sending down the url encoded webPageTest scripts.
The jmeter script outline is as follows then: