Getting startedGet an API key from Pat (required)Know your requests will have low prio /getLocations.phpBasic process:1. Submit request via POST or GET2. Poll for the test status (or use pingback)3. Fetch test results4. Fetch objects (charts, screen shots, ...)
Submitting requestsSend a POST or GET tohttp://www.webpagetest.org/runtest.phpurl is only required parameterDefaults: Dulles DSL, 1 run, first & repeatview, public, no videoOverview of parameters
ResultsExample XMLIt has it all, incl.1. PageSpeed version & results2. Page <title>3. Links to pages/files for everything in UI4. Video frame URLs & Speed Index score !
DocumentationOfficial API documentationPython lib for ad-hoc batch processingBatch processing command line tool
Lots of possibilities!https://sites.google.com/a/webpagetest.org/docs/using-webpagetest/scriptingNavigation/DOM interaction (submitForm)End Conditions (setDOMelement)Request Manipulation (setDNS)Misc (combineSteps)Great for simulating user-page interaction,multi-page testing and different conditions
Commands youll likely useCommand Descriptionnavigate Navigate to next page, wait for it to completelogData Set to 0 to not record anything; 1 = record!setValue Sets the value attribute of the given DOM element to the provided value.submitForm Triggers a submit event for the identified form.setDOMElement Sets the attribute of a DOM element that is required for the next event to complete successfully.block Blocks individual requests from loadingcombineSteps Causes multiple script steps to be combined into a single "step" in the resultssetViewportSize Changes size of visible browser windowfirefoxPref Allows you to specify arbitrary preferences that will be configured before launching the browser. Eg. firefoxPref network.http.pipelining falsesetDNS Allows for overriding the IP address for a host name.
Why did the test fail?Can be very hard to troubleshoot, esp. onlarge scripts