Hi Patrick,
Recently I have noticed that setViewportSize does not set the browser size to defined dimensions. It starts the test in the default browser window size no matter what the setViewportSize is set. I tried updating the agents to latest but still does not work in my private instance. Is this a known issue? I also tried running the test in public site with setViewportSize, it does not seem to resize the browser to the defined dimensions.
Here are couple of test I have tried in public instance with setViewportSize 300 600. Both the result show the browser size as 929x1047.
https://www.webpagetest.org/result/170322_TV_1E94/
https://www.webpagetest.org/result/170322_T3_1E8X/
Thanks
There aren’t any currently tracked issues on it, would you mind opening one? Issues · WPO-Foundation/webpagetest · GitHub
FWIW, setting the viewport size is a bit of a race at the start of the test where it has to launch the browser, measure the viewport, resize the window and give it enough time to actually resize before starting the test. It’s possible that one of the steps in that sequence broke.
Setting the browser size is significantly more reliable if you can do that instead (size of the full browser window itself) since that can be done immediately at startup with no measurement loop.
Oh, also if you are emulating a mobile device (which 300x600 sounds like) then using Chrome and the mobile emulation should give you consistently the requested viewport because it is set in the browser explicitly.
Thanks Patrick. I have opened the issue in github
https://github.com/WPO-Foundation/webpagetest/issues/853
Also 300x600 is just to try whether setViewportSize is working correctly or not at least for this time :-). I will change my framework to use mobile emulation instead of relying on setViewportSize.