Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yev/seleniummvnscreenshot
Allow your selenium suites to store automatically the screenshots taken for every failed test in maven target folder
https://github.com/yev/seleniummvnscreenshot
java jenkins maven screenshot selenium
Last synced: 26 days ago
JSON representation
Allow your selenium suites to store automatically the screenshots taken for every failed test in maven target folder
- Host: GitHub
- URL: https://github.com/yev/seleniummvnscreenshot
- Owner: yev
- License: apache-2.0
- Created: 2015-06-10T16:21:16.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-10-18T17:43:27.000Z (about 3 years ago)
- Last Synced: 2024-09-28T14:41:23.080Z (about 1 month ago)
- Topics: java, jenkins, maven, screenshot, selenium
- Language: Java
- Homepage: http://yevgen-fr.blogspot.fr/2015/06/selenium-screenshot-with-testng-and.html
- Size: 427 KB
- Stars: 7
- Watchers: 4
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Maven Package](https://github.com/yev/seleniumMvnScreenshot/actions/workflows/maven-publish.yml/badge.svg)](https://github.com/yev/seleniumMvnScreenshot/actions/workflows/maven-publish.yml)
# Welcome to the repository for Selenium auto screenshots for failed TestNg tests
-----------This is an open source framework integrating TestNG, Selenium 2 and maven, giving you a possibilty to automatically store **screenshots**, taken for every **failed** test in **maven** target folder, for their further investigation.
It features:
* Taking a **screenshot** of a **failed test**
* Including the **screenshot** to an **email sent** by your **CI-build**.
* Stocking taken **screenshots** in easy managable wayGetting started
-----------###Configuration
1. Put this jar to your classpath and annotate your class with special annotation ([see below](#annotation)).
2. No third-party dependencies.### How to use
--
1. Adding the following maven dependency in you ```pom.xml``` file:```xml
com.github.yev
screenshot
1.1
```
2. Adding next annotation: ```@org.testng.annotations.Listeners(org.yev.selenium.testng.FailTestScreenshotListener.class)``` to your TestNG Selenium class:![listener example](https://raw.githubusercontent.com/yev/seleniumMvnScreenshot/master/docs/ListenerExample.png)
3. Subsequently the plugin will find by reflection the **WebDriver instance** you are using and will do the rest for you.### Result
--
After running your TestNg selenium tests with Maven, you will find for each failed test the screenshot which was taken automatically when this particular test failed.![maven target dir example](https://raw.githubusercontent.com/yev/seleniumMvnScreenshot/master/docs/mvnTargerFolder.png)
### Integration with Jenkins build
--
It could be very useful to get the screenshot of failed test directly with email alert notification sent by Jenkins, when build becomes unstable.For our example case the jenkins config will be following:
![jenkins conf example](https://raw.githubusercontent.com/yev/seleniumMvnScreenshot/master/docs/selenium_Config_Jenkins_.png)