2

I'm trying to do this

$I->seeElement('DIV#security IMG.verisign'); 

to check if the images with the Verisign logo is loaded, but the test passes even if the image is not loaded (for a 404 if the file name of the source is wrong).

What's the right way to check for image loaded?

Naktibalda
  • 13,705
  • 5
  • 35
  • 51
realtebo
  • 23,922
  • 37
  • 112
  • 189

1 Answers1

2

You can check the naturalHeight to validate that the image correctly loaded:

$this->assertGreaterThan($element->getAttribute('naturalHeight'), 1);
Florent B.
  • 41,537
  • 7
  • 86
  • 101