collective / robotframework-selenium2screenshots

Robot Framework keyword library for capturing annotated screenshots with Selenium2Library
28 stars 12 forks source link

how to make screenshot comparison? #5

Open andreabisello opened 8 years ago

andreabisello commented 8 years ago

hi, any suggestion to make screenshot comparison and make test fail if two screenshot are not equal?

thanks.

emanlove commented 8 years ago

This is actually a fairly difficult task to implement if you want a repeatable and reliable test. I recommend that you take a look at applitools as a solution. I will note that I have never used their tool nor ever worked on a project that did. I have studied signal/image processing and after listening to Adam Carmi's, the co-founder/VP for R&D for appitools, talk at Selenium Conf 2015 they seem to have a good handle on this problem. This is also a great talk to see how difficult the problem can be.

That said there is an abandoned project, Huxley, that was created by Instragram/Facebook which tried to do this or some similar problem. If you search for selenium image comparison you will find several projects, both open source and closed, that try, like Huxley, to do this.

datakurre commented 8 years ago

How about combining Sikuli and Selenium with Robot Framework?

On 23. elokuuta 2016 klo 20.05 +0300, Ed Manlove notifications@github.com, wrote:

This is actually a fairly difficult task to implement if you want a repeatable and reliable test. I recommend that you take a look at applitools (https://applitools.com/) as a solution. I will note that I have never used their tool nor ever worked on a project that did. I have studied signal/image processing and after listening to Adam Carmi's, the co-founder/VP for R&D for appitools, talk at Selenium Conf 2015 (https://www.youtube.com/watch?v=CHUuLdkFfm0) they seem to have a good handle on this problem. This is also a great talk to see how difficult the problem can be.

That said there is an abandoned project, Huxley (https://github.com/facebookarchive/huxley/), that was created by Instragram/Facebook which tried to do this or some similar problem. If you search for selenium image comparison you will find several projects, both open source and closed, that try, like Huxley, to do this.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub (https://github.com/datakurre/robotframework-selenium2screenshots/issues/5#issuecomment-241803056), or mute the thread (https://github.com/notifications/unsubscribe-auth/AAJyv1dzbKZTk6_qFbrftUy3u6SxQ5tUks5qiyhlgaJpZM4JrFtI).

andreabisello commented 8 years ago

another way is to use needle (https://github.com/bfirsh/needle) on pure python code, and there is a implementation to use with robot ( https://github.com/laurentbristiel/robotframework-needle ) but the implementation works bad (if test fail, robot hangs) and, even i'm able to import python resources in robot framework, i'm not able to use needle in robot framework because something don't work (i got python exception, but i tried only yesterday evening).

my need is to understand if there is some kind of regression making a visual comparison. there are some tools to obtains this, , and applitools is awesome, but if possibile i want to use only robot framework.

yuriqp commented 7 years ago

@abioneperhobby did you have any progress on your search. Like you, I need a solution completely integrated with robot framework, because I already have the functional tests with it and I don't want to double the work, but just include visual tests.

andreabisello commented 7 years ago

@yuriqp yes i'm using robotframework-sikulilibrary http://rainmanwy.github.io/robotframework-SikuliLibrary/doc/SikuliLibrary.html

yuriqp commented 7 years ago

thanks for the reply, I end up writing my own library for using perceptualdiff (the same image comparison tool Needle uses) as a robotframework keyword.

On Mon, Apr 10, 2017 at 12:09 PM, Andrea Bisello notifications@github.com wrote:

@yuriqp https://github.com/yuriqp yes i'm using robotframework-sikulilibrary http://rainmanwy.github.io/ robotframework-SikuliLibrary/doc/SikuliLibrary.html

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/datakurre/robotframework-selenium2screenshots/issues/5#issuecomment-292906783, or mute the thread https://github.com/notifications/unsubscribe-auth/AIOz9Lckx0lnnMqYZy70vQsPC8TRzee2ks5ruf_GgaJpZM4JrFtI .

bbk4163 commented 6 years ago

@abioneperhobby , me too tried with needle but stuck due to hang issue. so looking at other options. how r u utilizing sikulilibrary? any resource to check or any guidelines could you please provide

datakurre commented 6 years ago

Probably related https://blog.codecentric.de/en/2017/09/robot-framework-compare-images-screenshots/

yuriqp commented 6 years ago

@bbk4163 you can try this :https://github.com/blooparksystems/robotframework-imagecompare

bbk4163 commented 6 years ago

@yuriqp thanks for sharing u r custom library will check on that for sure..

bbk4163 commented 6 years ago

@datakurre, i tried that one too, but i am facing DLL issue due to capabilities mis-match for which i am taking help here .. if you know any details pl help.

bbk4163 commented 6 years ago

Hi, @yuriqp, i have installed u r library using pip and i can see in the pip list {robotframework-imagecompare (0.1)}. Now i added Compare Images to my sample script but getting error keyword not found error. then tried to add the library like robotframework-imagecompare OR imagecompare no luck. pl add if i am missing anything here.

andreabisello commented 6 years ago

actually i

1) Capture Page Screenshot with SeleniumLibrary 2) Split the Page Screenshot in a matrix of smaller images with a python tool to help sikuli recognition 3) Use Sikuli to find images in the screen

obtaining A-B regression testing.

datakurre commented 6 years ago

@abioneperhobby Actually, if you are able to install OpenCV and its Python bindings onto your environment, you could use it directly from Python. (OpenCV is the computer vision library used by Sikuli.)

Example: https://nbviewer.jupyter.org/github/datakurre/robotkernel/blob/master/examples/OpenCV.ipynb

xr55 commented 6 years ago

can someone provide the java code to do image comparison and print the mismatches in a seperate file .