Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Screenshot dimensions not matching those specified in Huxleyfile #34

Open
plasticine opened this issue Nov 7, 2013 · 2 comments
Open

Comments

@plasticine
Copy link

Hey there,

I’m noticing that seems a bit weird is that the actual dimensions of snapped screenshots that I’m seeing don’t seem to match the dimensions that I specify in my Huxleyfile.

For example;

screensize=1024x768 will reliably result in an image of 1009x663 being written to disk, as will screensize=320x768 result in 305x663.

Seems fair to assume that the browser chrome is being deducted from the viewport area given the consistent 15px & 105px reduction in image size.

I’m assuming that this is a bug? Kinda seems weird behaviour, also is inconsistent to what other tools (phantomjs, for example) do—which is return an image of the same size as specified by screensize.

PS: Really loving Huxley, thanks for open-sourcing it! 💃

@chenglou
Copy link
Contributor

This is not a bug. It's how selenium interprets the dimensions being passed. I guess huxley could track the chrome dimensions and pass the correct values to selenium... Btw, I get 662 instead of 663.

@aman4you
Copy link

Specifying dimensions for screenshots using selenium firefoxdriver
for desktop view, driver.manage().window().setSize(new Dimension(1200, 1200));
for tablet view, driver.manage().window().setSize(new Dimension(600, 600));
for mobile view, driver.manage().window().setSize(new Dimension(300, 300));

if web page actual dimension 1614 by 1697 then screenshot dimension
for desktop view 1437 by 2770
for tablet view 701 by 3695
for mobile view 696 by 5082

width of screenshot decreasing while height increasing but screenshot dimension not match with specified dimension

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants