AShot library
Ashot library by yandex.ru is something which I recently found. It can be used for multiple browsers.
It is very simple to use.
Just add maven dependency in your java code.
Then call the takeScreenshot() function,as shown below and you have a screenshot file.
You could even select specific html elements and take their screenshots.
All this can be found at below repository.
https://github.com/yandex-qatools/ashot
Know of any more libraries to take browser screenshots ? Let me know in the comments.
Ashot library by yandex.ru is something which I recently found. It can be used for multiple browsers.
It is very simple to use.
Just add maven dependency in your java code.
<dependency> <groupId>ru.yandex.qatools.ashot</groupId> <artifactId>ashot</artifactId> <version>1.5.2</version> </dependency> </pre>
Then call the takeScreenshot() function,as shown below and you have a screenshot file.
new AShot() .shootingStrategy(ShootingStrategies.viewportPasting(100)) .takeScreenshot(myWebDriver);
You could even select specific html elements and take their screenshots.
WebElement webElement = webDriver.findElement(By.cssSelector("#element_to_be _captured")); new AShot() .takeScreenshot(myWebDriver, webElement);
All this can be found at below repository.
https://github.com/yandex-qatools/ashot
Know of any more libraries to take browser screenshots ? Let me know in the comments.
Comments
Post a Comment
Have some feedback, comment or question ?
Post it here in comments section.