Skip to content

anasmi/testbenchScreenshot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Creating screenshots

A simple Java class utility to create screenshots from your tests. Uses Selenium with headless Chrome.

Usage

To build the executable jar you should run: mvn clean package

You can then run the utility:

java -jar target/screenshootlibrary-2.0-SNAPSHOT-jar-with-dependencies.jar <url> <filename> <width> <height>

You can specify only the URL and file name. Some examples:

# Take screenshot in default size and use timestamped output file name.
java -jar target/screenshootlibrary-2.0-SNAPSHOT-jar-with-dependencies.jar https://vaadin.com/

# Take screenshot in default size and use the given filename
java -jar target/screenshootlibrary-2.0-SNAPSHOT-jar-with-dependencies.jar https://vaadin.com/ frontpage.png

# Specify all the parameters: URL, filename width and height in pixels
java -jar target/screenshootlibrary-2.0-SNAPSHOT-jar-with-dependencies.jar https://vaadin.com/ frontpage.png 800 600


About

A Simple class to take screenshots from your test

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages