Question

is there a way to detect colors by Selenium (priority to phpunit selenium).

I have banners in the site and some of them doesn't reloaded, it strange I have their element but all I see on the screen is only a white color. I want use selenium to check when find if it happens again. if there are banner with a white color.

is there a chance it possible?

Was it helpful?

Solution 2

You can take the screenshot and try the following.

<?php 
    $image = new Imagick('testimage.jpg'); 
    $x = 1;  
    $y = 1; 
    $pixel = $image->getImagePixelColor($x, $y); 
?> 

You can also check this Libraryphp docs for other options.

OTHER TIPS

This task can be done using java.awt.Robot | I haven't tried any for PHP

Robot r = new Robot();
r.getPixelColor(923, 87); 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top