Re: Image comparison in Selenium

98 views
Skip to first unread message

Bromine

unread,
Aug 5, 2008, 5:14:09 AM8/5/08
to selenium-users...@googlegroups.com
http://clearspace.openqa.org/message/47403#47403
It's not java but the algorithm is universal

Tarun

unread,
Aug 5, 2008, 5:28:49 AM8/5/08
to selenium-users...@googlegroups.com
May be but it is not working for me.

I thought I will be screen shot of application pages in advance and during tests I will be taking screen shots and comparing them with the one I have. I faced two problem here -

1. When I take screen shot in java/selenium then I was expecting it to take screen shot of page inside the browser and not the screen shot of whole window. This way I miss app page as there are scroll bars in the app. Probably there is a way to capture it which I am not aware of!!!!

2. Link given by you is impressive but I am under impression that I can not use java client driver of selenium RC while using Bromine.

It might be +discourteous+ on my part to ask you as to how you have implemented it, but if possible then please throw some light.

Thanks in advance
Tarun K

Bromine

unread,
Aug 5, 2008, 5:59:37 AM8/5/08
to selenium-users...@googlegroups.com
1. This is the real problem you are facing, and to my knowledge there is no easy way to overcome this. At my work i don't have to compare the entire page, i only have to compare two maps (see it at http://krak.dk/kort) created by n x n images of 256px x 256px. I've created a function grabMap() (not released) which uses getXpathCount() and getAttribute() to recreate the map from the 16, 25 or 36 images the map is composed of. I start my test using grapMap(), then i zoom and pan around in such a way that i end at the exact same place where i started. Then i use grapMap() again, and use compare() on the 2 created maps.

2. This is right, but the class i have released has nothing to do with Bromine. It's a simple PHP script. I was thinking you could take a look at it and translate the algorithm to java if you needed something in java.

Cheers


Reply all
Reply to author
Forward
0 new messages