Welcome, Guest! Log In | Create Account

Hosted Scripting

From pagetest

Jump to: navigation, search

The hosted version of pagetest supports executing uploaded scripts. The scripting capabilities are a subset of the full capabilities offered by pagetest (full docs on the language here).

The differences are:

  • The hosted scripts can only have one step that produce data (see below for examples on how to suppress results for intermediate steps)
  • None of the commands that use external files are allowed (loadFile, loadVariables, fileDialog)

In order to suppress intermediate steps you need to make sure that data logging is disabled for the steps up to the one you want to record. For example:

logData    0

// put any urls you want to navigate
navigate    www.aol.com
navigate    news.aol.com

logData    1

// this step will get recorded
navigate    news.aol.com/world

The script above will navigate to the main aol portal, then to the news page and then finally to the world-news specific page (logging results for just the world news page). This lets you test the impact of a given path to a site on it's performance (shared css and js caching for example).

Another significant use case is if you want to test a site that requires authentication. Here is what an authentication script would look like:

logData	0

// bring up the login screen
navigate	http://webmail.aol.com

logData	1

// log in
setValue	name=loginId	someuser@aol.com
setValue	name=password	somepassword
submitForm	name=AOLLoginForm

You won't get a lot of feedback as to why a script failed so make sure to test your scripts locally with the desktop version of pagetest (file->Run Script) before uploading them for hosted testing. You can probably get away with a simple navigation path without testing but not the fancier scripts.