Validating Screen Shots

63 views
Skip to first unread message

Jatin Davey

unread,
Mar 27, 2012, 1:54:21 AM3/27/12
to seleniu...@googlegroups.com
Hi

I have been using selenium for some time now. Whatever tests i do with selenium i capture the entire screen shot of all the tests and then manually verify the screen shots. Is there a way i can automate this process as well. 

I mean i can have a set of screen shots that i have saved and consider them to be correct and then on the later builds i run the same tests and compare the new screen shots to the old one's and fully automate the entire process. 

Any other thoughts and comments are also welcome.

Thanks
Jatin

Mark Collin

unread,
Mar 27, 2012, 3:55:02 AM3/27/12
to seleniu...@googlegroups.com

Generally it’s a huge time sink and a waste of time IMHO.

 

If you perform a screenshot comparison you will pick up the fact that a text box is 1px to the right in one image and the test will fail when it looks identical visually.  To stop this happening you need to add in a degree of acceptable failure, unfortunately a computer can’t easily tell what is an acceptable difference and what is an unacceptable difference.  So this becomes a constant battle of detecting problems but not detecting differences that are meaningless.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

Jatin

unread,
Mar 27, 2012, 11:58:09 AM3/27/12
to seleniu...@googlegroups.com
Yes , Agree with you in this regard. So the next question is what other approach would be better off considering the complexity as well as somthing that can be done in short time. Couple of things that i can think off:

1. Use the selenium.getBodyText() method and save them across all the pages that are accessed when we run the tests and then comparing the already validated page results with the new values in a later build.

2. Use the selenium method to get the entire HTML page source and then use it to compare in a similar way as mentioned in the point 1.

I dont feel better to use the various verifyEquals() method as i would have a lot of such code and maintaining it would be another huge task.

I would appreciate any thoughts and suggestions in this regard.

Thanks
Jatin

Oscar Rieken

unread,
Mar 27, 2012, 12:07:23 PM3/27/12
to seleniu...@googlegroups.com
this thing looks pretty cool

http://code.google.com/p/narcissus-webtests/

Ed Manlove

unread,
Mar 27, 2012, 3:15:23 PM3/27/12
to Selenium Users
Jatin,

You might check out Kevin Menard's work on testing visual consistency
and his company MogoTest, http://mogotest.com/. Kevin gave an
interesting talk on this subject at GTAC 2011 seen here

http://blog.lightbody.net/day/2011/11/07

(via Simon Fletcher @ blog.lightbody.net)

Ed

Jatin

unread,
Mar 29, 2012, 12:09:33 PM3/29/12
to seleniu...@googlegroups.com
Have you personally used it ?

Jatin

unread,
Mar 29, 2012, 12:25:35 PM3/29/12
to seleniu...@googlegroups.com

> Jatin,
>
> You might check out Kevin Menard's work on testing visual consistency
> and his company MogoTest, http://mogotest.com/. Kevin gave an
> interesting talk on this subject at GTAC 2011 seen here
>
> http://blog.lightbody.net/day/2011/11/07
>
> (via Simon Fletcher @ blog.lightbody.net)
>
> Ed
>
Thanks Ed.

Would take a look at the trial version and get back.

Thanks
Jatin

Yong Wang

unread,
Mar 31, 2012, 4:07:39 AM3/31/12
to seleniu...@googlegroups.com
you may consider to integrate Sikuli into your test, which have java api.  You just need save a small picture of a success tag something, then call Sikuli to verify if exist in your screen shot or not.

more info can be found at http://sikuli.org/


Jatin

--

Yong Wang

unread,
Mar 31, 2012, 4:17:14 AM3/31/12
to seleniu...@googlegroups.com

David

unread,
Apr 1, 2012, 2:10:35 AM4/1/12
to Selenium Users
I was also going to suggest Sikuli as Yong mentions. It also has a
Python scripting API, if Java is not as desirable (or use other Java
based scripting interpreter to use the Java API outside of Java, like
JRuby, etc.)

And for another option and a Python based one, check out
https://github.com/msanders/autopy

And for a commercially supported tool that is like Sikuli, check out
Experitest's SeeTest.

On Mar 31, 1:17 am, Yong Wang <wahaha2...@gmail.com> wrote:
> http://sikuli.org/docx/faq/030-java-dev.html
>
>
>
>
>
>
>
> On Sat, Mar 31, 2012 at 4:07 PM, Yong Wang <wahaha2...@gmail.com> wrote:
> > you may consider to integrate Sikuli into your test, which have java api.
> > You just need save a small picture of a success tag something, then call
> > Sikuli to verify if exist in your screen shot or not.
>
> > more info can be found athttp://sikuli.org/
Reply all
Reply to author
Forward
0 new messages