Size resize window with scale


#1

Use this code to resize browser to 640x480 and take screenshot

{
“Name”: “Electrastyle_Не авторизован”,
“CreationDate”: “2019-2-14”,
“Commands”: [
{
“Command”: “store”,
“Target”: “15”,
“Value”: “!TIMEOUT_WAIT”
},
{
“Command”: “store”,
“Target”: “60”,
“Value”: “!TIMEOUT_PAGELOAD”
},
{
“Command”: “open”,
“Target”: “https://stage.electrastyle.ru/index_new.php”,
“Value”: “”
},
{
“Command”: “echo”,
“Target”: “Скрыть кнопку подписки на браузерные уведомления”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “//*[contains(@class, ‘comeback-disallow-btn’)]”,
“Value”: “”
},
{
“Command”: “store”,
“Target”: “640@480”,
“Value”: “resolution”
},
{
“Command”: “resize”,
“Target”: “{resolution}", "Value": "" }, { "Command": "echo", "Target": "Скриншот главной, полный экран", "Value": "" }, { "Command": "captureEntirePageScreenshot", "Target": "electrastyle_{resolution}_unauth_main”,
“Value”: “”
}
]
}

But in output screenshot width: 976px (scale 1.525)

Work in Firefox 65.0 on ubuntu 18 in private window. Use latest version firefox Kantu addon (v3.8.7)

What wrong with my code?


#2

Hi, what scale parameter is this?

And what DPI does your screen have (96, 120,…)?


#3

Hi, what scale parameter is this?

Its reference information for understanding that real window width less than screenshot width.

And what DPI does your screen have (96, 120,…)?

DPI 166 (xiaomi mi air, 13,3", 1920x1080px)


#4

Thanks for the info. As another test, if you use this resizer extension, does it work then?


#5

Yes, its work perfect. But its extension for chrome. I use Firefox cuz resize not work in Chrome.


#6

We did some more tests here and all seems to work fine.

Example:

Kantu’s Resize | 1024@768 command brings the browser in exactly the same dimensions as if you would use e. g. the Window Resizer tool. Note that you need to select “viewport” to compare.

But you are also correct :smiley:: If you take a screenshot of the browser on a HiDPI machine (like your laptop) the dimensions will be scaled. For example, I am currently connected to a 120dpi monitor, so the 1024@768 resized browser gives a screenshot of 1260x962px (factor 120dpi/96dpi).

resizer


#7

Thank you for answer. I do some test too and find, that resize params not affected to window size if I use variable from storage as target.

So this is not work:
%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5

But this work perfect:
%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5


#8

Hmm, thanks for the info. But it still works for me. Can you add a screencast of how it looks for you?