Current time: 12-13-2017, 01:56 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New script commands and capabilities
12-11-2010, 11:41 AM (This post was last modified: 12-11-2010 11:42 AM by pmeenan.)
Post: #1
New script commands and capabilities
It's been a busy week in the Pagetest scripting engine....


First, I finally added support for combining multiple script steps into a single sequence (particularly necessary for doing a video comparison of multiple steps):

http://www.webperformancecentral.com/wik...mbineSteps

Here is a test that merges loading Google then Yahoo then AOL: http://www.webpagetest.org/result/101211...87f429fd5/

Along with a filmstrip for good measure: http://www.webpagetest.org/video/compare...d5-r:1-c:0

This is the script:

Code:
combineSteps
navigate              www.google.com
navigate              www.yahoo.com
navigate              www.aol.com


Next (and I'm REALLY excited about this one), I have created a Javascript interface into Pagetest that page code can talk to. Right now there are only 2 methods but this opens up a lot of future possibilities:

The two methods are:
window.webpagetest.done() - If WebPagetest is running a script that tells it to wait for JS done this will end the test (see below)
window.webpagetest.message("message string") - This will send a timestamped message to the browser status messages (visible at the bottom of the screen shot page)

I have a sample page at http://www.patrickmeenan.com/test/dom/test.html that sends a message to the status window, sets a 15 second timer and then in the timer routine sends another message and calls done()

Here is what the result looks like:

http://www.webpagetest.org/result/101210...afae1306f/ (notice the 15 second fully loaded time).

The messages that were logged from the javascript are visible here: http://www.webpagetest.org/result/101210...reen_shot/ (scroll to the status messages below the screen shots).

The script command to force the test to wait is "waitForJSDone". Here is the script that I used for the test:

Code:
waitForJSDone
navigate              http://www.patrickmeenan.com/test/dom/test.html
Visit this user's website Find all posts by this user
Quote this message in a reply
12-12-2010, 08:50 PM
Post: #2
RE: New script commands and capabilities
(12-11-2010 11:41 AM)pmeenan Wrote:  window.webpagetest.message("message string") - This will send a timestamped message to the browser status messages (visible at the bottom of the screen shot page)

Awesome!
What would be nice is to also incorporate these into the waterfall charts(vertical lines)... so we can specify when exactly the page was "usable" , etc...

cdnplanet.com: We help you select the right CDN
Visit this user's website Find all posts by this user
Quote this message in a reply
12-13-2010, 03:34 AM
Post: #3
RE: New script commands and capabilities
Ahh, great minds.... I don't think I'll do full lines but I'm considering markers at the top of the waterfall to indicate the messages and when you hover you would get the message text. If I get a chance you should see something live before the end of the week :-)
Visit this user's website Find all posts by this user
Quote this message in a reply
07-16-2014, 05:22 AM
Post: #4
RE: New script commands and capabilities
(12-11-2010 11:41 AM)pmeenan Wrote:  The messages that were logged from the javascript are visible here: http://www.webpagetest.org/result/101210...reen_shot/ (scroll to the status messages below the screen shots).

Does the window.webpagetest.message function still exist? I'm not seeing the messages on the screenshot page.
Find all posts by this user
Quote this message in a reply
07-22-2014, 06:38 AM
Post: #5
RE: New script commands and capabilities
Not with the newer browsers. I report console.log for Chrome and there are plans to add it for the other browsers as well.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)