Danny Ackerman
Danny Ackerman

Reputation: 997

Capture screenshot of specific element using NodeJS and Browserstack

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

Answers (3)

dontmentionthebackup
dontmentionthebackup

Reputation: 2915

Exactly what you are looking for:

https://github.com/firstandthird/stackshots

Upvotes: 0

Akshay
Akshay

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

Mike Causer
Mike Causer

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

Related Questions