Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

How to just capture screenshot of the window? #14

Closed
millisami opened this Issue · 2 comments

4 participants

@millisami

Right now, headless.take_screenshot('./somefile.jpg') works great!

But the saved file has all the Menubar, address bar, scrollbar attached.

Is there any other function call or params that can be passed to just capture the content window only without the Menubars,status bar, scroll bar, ..etc.??

@iafonov

Currently there is no way to do it via headless. Maybe you can figure it out yourself if you definitely need it. Headless uses import utility from imagemagick and it can accept window id or name (see - man - http://www.imagemagick.org/script/command-line-options.php?ImageMagick=op7slcr8l6l27lekiqiif8e6t2#write), you can pass id/name to take_screenshot method and put it instead of root. (See - https://github.com/leonid-shevtsov/headless/blob/master/lib/headless.rb#L118)

@anikkar

You could also enable to browser to full screen:

driver.find_element(:tag_name => 'html').send_keys(Selenium::WebDriver::Keys[:f11]) #full screen cmd for Firefox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.