The WebPageTest blog contains numerous posts to guide users through the site, but it can also be a bit overwhelming…
To help you conduct a basic performance test, we have created the walk-through below.
Add Scripts to your Test
- Create a basic test as you normally would.
(For help getting started with a basic test, please refer to my Getting to Know… WebPageTest article.)
- Once you have a basic test ready to run, in the Advanced Configuration panel, click the Scripts tab:
- You should now see a panel like this:
- If you find yourself wanting to repeatedly use similar scripts, you may want to save them somewhere as files, which you can then easily “import” using this link.
Note: The phrase “text file” is not limited to a
.txtfile, it just means a text-based file; a
.jsfile will upload just fine as well.
- If you have to add username, passwords, or anything else that you deem sensitive, checking this will remove the Script info from the results so no one else can see it, and it will not be stored on any WPT server or system.
- Similarly, checking this removes the HTTP headers from the results of this test.
- Their documentation link is extremely helpful in getting to know the basic commands you can use in here. Scroll through the entire page or choose from the options in the Recommended Commands panel on the right. Also see the Shared Recipes section below for more example scripts.
- A common script you might want to run would be adding a cookie before page load in order to force a modernized version of a page or prevent a popover from loading. Such a script would look something like this:
// set a cookie before opening the page (name and value) setCookie %ORIGIN% name=value // navigate to page navigate %URL%
Note the final
navigatecommand. This is required for any test that uses anything in the Script panel.
Also note the
%URL%variable being used here. There are several variables available to you to help make your scripts more flexible for use across multiple pages, locales and even brands.
- Other common script uses would be performing multi-page tests, or interacting with the UI in some way, such as a checkout flow.
- Once you have your Script as you want it, continue building the rest of your test as you want, then run that test.
- Once the test has completed, you can review the results as you normally would any other test.
- And don’t forget that, you can share any test you run with others, and, provided you were logged in before running this test, you can also revisit previous tests and even re-run it.
- Speedcurve Recipes:
- WebPageTest API:
- If you happen to be using the WebPageTest API, you can choose from among these helpful recipes.
- From within Github, you can copy or download specific files for use within your API testing.