ruby - Take screenshot using watir extension element screenshot -


i using watir web driver, go url , fetch screenshot.

i able take screenshot whole page, unable take particular element. tried watir extension element still not able figure it.

this code

require "watir" require 'watir/extensions/element/screenshot' browser = watir::browser.new browser.goto "http://images.morefrom.co.uk/prodmainimg.aspx?pn=7350022730991&man=multibrackets" browser.screenshot.save 's.jpg' 

i want take screenshot of particular image in page there no div, tried

browser.body.img.screenshot.save 's.jpg' 

`screenshot': wrong number of arguments (0 1) (argumenterror)

what should doing?

i think have found it

browser.body.img.screenshot("s.jpg") 

Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -