Benchmarks and Scripting

I did not realize WPT has benchmarking capabilities till I ran into the code.

I saw a few samples and here’s my quick question: Can I add a script instead of a URL for the benchmark value

Say the current bm.txt looks as follows

Landing Page http://news.yahoo.com/

Can I do something like

Landing B Page

If not, I would like to do it as its immensely helpful to me in m yday to day work

Nevermind, I found the solution by reading the document here:

https://sites.google.com/a/webpagetest.org/docs/developer-information/design-docs/benchmarks

Warning, the benchmark support is still pretty rough, though feedback is very much appreciated.

Yes, There are 2 ways to do it depending on if you want a bunch of different scripts (1) or the same script applied to a bunch of different URLs (2).

  1. The URL list can contain scripts or urls for each entry. It’s a bit convoluted because the script needs to fit on one line in the url list so you need to use \t for the tab separators and \n for the line separators. i.e.:

script:setDns\twww.webpagetest.org\t1.2.3.4\nnavigate\thttp://www.webpagetest.org/

  1. You can pass a script as a test option. The scripts support a couple of substitution markers so that you can use the same script with a bunch of URLs:
    %URL% - gets replaced with the URL being tested
    %HOST% - gets replaced with the host name of the URL being tested

A script can look like:
setDns %HOST% 1.2.3.4
navigate %URL%

Then any URL tested will have it’s host name redirected to 1.2.3.4 before navigating to the test page.

Is there any way to save the results of all websites if i use automated script to navigate the URL’s.

Example:

logData 1
navigate news.aol.com
navigate www.google.com
navigate www.aol.com

I want to log the results for all 3 websites.How can I do that?

You can’t, it has to be done as 3 separate tests, each one only logging data for one of the steps.

It’s mostly a UI/processing issue with being able to present multiple steps in a single test (pull requests that hack away at the problem without breaking the existing behavior are welcome).