Hi every Monks ! I am appealing to your wisdom yet again. I have an issue. Iam using Selenium::Screenshot. I get screenshots i'd like to compare. I did this following code:
$driver->set_window_size(320, 480);
$elem = $driver->find_element('applgs','id' );
my $white = Selenium::Screenshot->new(
png => $driver->screenshot,
exclude => [{
size => { width => 10, height => 10 },
location => { x => 5, y => 5 },
}]
)->save( file => "snapScreenshot" );
$driver->execute_script('document.getElementsByTagName("body")[0].
+style.backgroundColor = "red"');
my $blue = Selenium::Screenshot->new(png => $driver->screenshot)->
+save( file => "snapScreenshot1" );
unless ($white->compare($blue)) {
my $diff_file = $white->difference($blue);
print 'The images differ; see ' . $diff_file . ' for details';
}
But i get after this ouput in my Shell:
not ok 22 - A_test died (Can't locate object method "compare" via pack
+age "D:/t/gui-tests/tests/screenshots/snapScreenshot-firefox.png
" (perhaps you forgot to load "D:/t/gui-tests/tests/screenshots/snapSc
+reenshot-firefox.png"?) at MyTestingSuite.pm line 260.)
I have my 2 screenshots and one of them have got effectively its body in red.
Somenone can help ?
Many Thanks !!