lundi 21 décembre 2015

Testing a class that takes screenshots feeding my images instead of screen

I have programmed my own java classes, which are injected a java.awt.robot. The classes take partial screenshots and examine pixels. Now for the test, I want to inject another variant of java.awt.robot, so that it does not actually take screenshots, but I let it feed my own images. What I want to do exactly is, when it takes a first rectangle screenshot I want to feed it a certain screensize picture, and for all subsequent actions that are peformed on the robot I want to let it use one certain other picture (instead of the screen).

I was figuring I might use the other constructor: http://ift.tt/1OH5wOh

but I wouldn't know how to instantiate one or how to use my own images in it.

Just to avoid popular confustion, I'm NOT using the robot functionality to click and test my application. This is something wholly different.

Aucun commentaire:

Enregistrer un commentaire