WebPagetest Forums
Benchmarks and Scripting - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: WebPagetest (/forumdisplay.php?fid=7)
+--- Forum: General Discussion (/forumdisplay.php?fid=25)
+--- Thread: Benchmarks and Scripting (/showthread.php?tid=13058)



Benchmarks and Scripting - pganti - 06-24-2014 04:43 AM

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 <insert setDns and navigate here>

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


RE: Benchmarks and Scripting - pganti - 06-24-2014 06:24 AM

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

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


RE: Benchmarks and Scripting - pmeenan - 06-24-2014 06:32 AM

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/

2) 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.


RE: Benchmarks and Scripting - eddy - 06-28-2014 12:42 AM

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 http://www.google.com
navigate http://www.aol.com

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


RE: Benchmarks and Scripting - pmeenan - 07-01-2014 04:06 AM

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).