Here are some tips for debugging your WebPageTest scripts:
- Tabs - Scripts should be tab delimited with only some options accepting spaces between values. This is often the main cause of issues, so check your script in an IDE with invisible characters shown to ensure the formatting is correct.
- Use webpagetest.org - For quickly iterating over script variations use public WebPageTest to run one off tests. This also helps debug if the issue is SpeedCurve related or not. Watch out for tip #1 when copying and pasting scripts back to SpeedCurve though as they must used tabs.
- Hidden errors - Many scripts use "logData 0" to hide steps. If you're having issues try removing the "logData 0" command so that you can identify where in the script the test is failing.
- Only use the "andWait" version of commands like "execAndWait" when the command will cause a page transition.
- Multi-step scripts - SpeedCurve does not yet support extracting waterfall charts from multi-step scripts. Instead use "logData 0" at the beginning of the script and then "logData 1" just before your final step to record just a single step or navigate command.
What to do when a script stops working
If you have a script that used to work, but suddenly stops working, the following tips might help:
- Remove the "logData 0" commands and run the script on webpagetest.org. This will highlight which part of the script is failing.
- Run each of the steps in the console of your browser's DevTools. Check that each step produces the desired result.
- Check that all of the element selectors used in the script still exist on the page.
Need extra help?
We try to help out where we can, but we don't provide support for deep debugging of WebPageTest scripts. We can recommend WebPageTest consultants who are experts in scripting and can help out if you're interested. Send us a note at email@example.com and we'll connect you!