WebPagetest Forums
setViewportSize is not working - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: WebPagetest (/forumdisplay.php?fid=7)
+--- Forum: Private Instances (/forumdisplay.php?fid=12)
+--- Thread: setViewportSize is not working (/showthread.php?tid=14813)



setViewportSize is not working - sadhikari - 03-23-2017 07:10 AM

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


RE: setViewportSize is not working - pmeenan - 03-23-2017 11:14 PM

There aren't any currently tracked issues on it, would you mind opening one? https://github.com/WPO-Foundation/webpagetest/issues

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.


RE: setViewportSize is not working - pmeenan - 03-23-2017 11:15 PM

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.


RE: setViewportSize is not working - sadhikari - 03-24-2017 04:34 AM

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.