in reply to Selenium Screenshot

Hello Chaoui05,

Whether you’re using Selenium::Screenshot or Image::Compare, the images to be compared must have the same size. So you need to resize (at least one of) the images; for this you can use the scale method in the Imager module. This method is documented in Imager::Transformations.

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Replies are listed 'Best First'.
Re^2: Selenium Screenshot
by Chaoui05 (Scribe) on May 24, 2016 at 13:00 UTC
    Hey ! Thanks. I will see that
Re^2: Selenium Screenshot
by Chaoui05 (Scribe) on May 24, 2016 at 13:13 UTC
    I have another question if you would like to take 2 mins. I have this following method :
    $elem = $driver->find_element('app-lgs','id' ); Selenium::Screenshot->new( png => $driver->screenshot, exclude => [{ size => $elem->get_size, location => $elem->get_element_location, }] )->save( file => "screen.png" );
    But there is no example added to describe how to use it. I tried code below but it doesn't work:
    Selenium::Screenshot->new( png => $driver->screenshot, exclude => [{ size => { width => 10, height => 10 } location => { x => 5, y => 5 }, }]
    Have you got an example to purpose me ? Thanks again !

      The documentation of Selenium::Screenshot discusses what the parameters are for. Which parts of the documentation are unclear for you?

        Hi Corion ! Documentation is clear. I would like ,in my case, to exclude a part of my website's page. And get and return it in a screenshot . I effectively have screenshot but there is no black out area inside. I don't know whether I am making myself clear. In any case, Thanks