Chaoui05 has asked for the wisdom of the Perl Monks concerning the following question:
Thanks to everyone !my $driver = Selenium::Remote::Driver->new; $driver->set_window_size(320, 480); $driver->get('http://www.google.com/404'); my $white = Selenium::Screenshot->new(png => $driver->screenshot); # Alter the page by turning the background blue $driver->execute_script('document.getElementsByTagName("body")[0].styl +e.backgroundColor = "blue"'); # Take another screenshot my $blue = Selenium::Screenshot->new(png => $driver->screenshot); unless ($white->compare($blue)) { my $diff_file = $white->difference($blue); print 'The images differ; see ' . $diff_file . ' for details'; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Selenium Screenshot
by Athanasius (Archbishop) on May 24, 2016 at 12:02 UTC | |
by Chaoui05 (Scribe) on May 24, 2016 at 13:00 UTC | |
by Chaoui05 (Scribe) on May 24, 2016 at 13:13 UTC | |
by Corion (Patriarch) on May 24, 2016 at 13:18 UTC | |
by Chaoui05 (Scribe) on May 24, 2016 at 13:41 UTC |