Configuring exact viewport size

Hi,

I was wondering if it is possible to configure an exact pixel value for the width and height of the viewport when testing in Chrome. It appears that when configuring the test parameters, there is an option under the “Chrome” tag called “Command line”.

I did some research as to what command line syntax could be used to adjust viewport/window size, and came across the following commands:

[code]–app-shell-host-window-size=WxH

–ash-host-window-bounds=WxH

–content-shell-host-window-size=WxH

–window-size=W,H[/code]

I tried keeping it simple, and setting –window-size=1100,600, but it appears that the screenshot I get back does not match those dimensions. Also, the waterfall timeline indicates that creatives that should be rendered at those viewport dimensions are, in fact, not being requested or rendered.

Are there additional command lines (or am I using incorrect syntax?) that will achieve the desired results? Viewport width is the real concern here, so anything that can ensure a viewport width greater than 1050px would suffice. Height is more or less irrelevant outside of it being tall[/code] enough to provide a useful screenshot.

You need to use a script with the setViewportSize command: https://sites.google.com/a/webpagetest.org/docs/using-webpagetest/scripting#TOC-setViewportSize

Otherwise WebPagetest is going to resize the browser no matter how you launch it.

Ok, I think I got it right this time. I included a script consisting of only 2 lines in the textarea provided for scripts:

navigate http://url.com setViewportSize 1100 600

Spaces are tab delineated in the actual script - I’m currently waiting for the results

Flip the order around (though it might still work just because of how the agent code works). You generally want to do all of the set-up before navigating and usually the scripts execute from top-to bottom.

Thank you, it looks like the results from tests including the script syntax I included in my last reply did the trick, but it makes sense to carry out viewport resizing before navigating to the target URL, so I will use that technique in future tests.

If we want to run this through the api, like automated schedule webpage test for a size.
How can we use this script ? How to we send the script parameter

For example for tools like speedtracker.org