Management of images in sikuli
I am currently working on a project that requires automating tests on a content player,
I am using sikuli for it.
The problem is that we have piled up a large amount of screenshots which is becoming difficult to manage day by day.Size of image folder is becoming larger day by day. we want to reuse the older images as much as possible, but finding similar images is what has become a headache.
Is there a tool which could find similar screenshots from a folder? is there any strategy we could use further to manage it ?
Well, one of the options I can think of is to use Sikuli itself to find similar images. You can set the image in a pattern and then try to locate similar images on the screen. Once you locate those similar images, you can do whatever you want with them, still using Sikuli.
Just as an example, you can define a function:
def recycleAll(x) for region in find(x).anySize().regions: dragDrop(region, "recycleBinImg.png")
And then call it from your main code like that:
patterns = ["imagePatern1.png", "imagePatern2.png", "imagePatern3.png"] for x in patterns: recycleAll(x)
In this case, all images as in pattern will be dragged from the screen to Recycle Bin. This code could be changed not to delete all the occurrences of the images as in the pattern and leave one of them.
Of course you have to consider how your images look like, are the similar ones are truly identical? If now you might want to search now using the whole image but use just a smaller part which will be unique to the images you want to find.