Reputation: 997
Does anyone know if there's a way to use NodeJs to drive Browserstack and capture a screenshot of a specific element on the page?
Thanks!
Upvotes: 1
Views: 5045
Reputation: 2915
Exactly what you are looking for:
https://github.com/firstandthird/stackshots
Upvotes: 0
Reputation: 106
The below given links give a sample to capture screenshot of an element using php. You can use it as a reference to write code in Node. If you face any problem, please feel free to ask.
https://github.com/facebook/php-webdriver/wiki/Taking-Full-Screenshot-and-of-an-Element
Upvotes: 0
Reputation: 8324
You can do it using PhantomJS.
Screenshot the entire page: Phantomjs - take screenshot of a web page
Screenshot cropped to the dimensions of a specific element: Crop screenshot to element in PhantomJS
More PhantomJS examples: https://github.com/ariya/phantomjs/wiki/Examples
Upvotes: 2