Kevin
Kevin

Reputation: 217

Using Image Magick with Junit and Selenium

Can somebody guide as to how can I use image magick or jmagick in designing automation visualization testing.

Basically I want to automate comparison of screenshots(new with old) of web applications.

I have configured Selenium to run with junit core in eclipse. I am am still figuring how to use image magick with this configuration. Are there any links?

Any help is appreciated.

Upvotes: 1

Views: 2039

Answers (1)

Kurt Pfeifle
Kurt Pfeifle

Reputation: 90203

To visually compare a reference screenshot to a to-be-tested one with the most simple command, just run this one (or translate it into its equivalence in jmagick):

 compare reference.jpeg to-be-tested.jpeg -compose src diff.jpeg
  • If both are visually equal, your diff.jpeg will be a white image.
  • If both are visually different, the diff.pdf will mark differences with red pixels (while white pixels still mean: 'no difference here').

Example

On the right: the "Diff" image.

See also Imagemagick : “Diff” an Image.

Upvotes: 1

Related Questions