phpunit-selenium icon indicating copy to clipboard operation
phpunit-selenium copied to clipboard

Get screenshots on errors also

Open lsolesen opened this issue 12 years ago • 7 comments

I will be very helpful, if it was possible to get a screenshot on Errors also.

lsolesen avatar Jun 04 '12 05:06 lsolesen

Can you be more precise?

  • Selenium 1 or Selenium 2?
  • Error defined as the E produced by PHPUnit (PHPUnit_Framework_Error exception) instead of an F in the test result?

giorgiosironi avatar Jun 04 '12 12:06 giorgiosironi

E defined as the errors in PHPUnit. I do not want the screenshot instead of those produced on F, but in addition to. Using Selenium 2.22.0.

lsolesen avatar Jun 04 '12 12:06 lsolesen

I added the test shown here, but it already passes (in the sense that the exception that gets thrown contains the path to a generated image). Can you give me a failing one?

giorgiosironi avatar Jun 08 '12 08:06 giorgiosironi

Correct me if I am wrong. I assume that the screenshot capturing in SeleniumTestCase was being done on the same host as the selenium server is running, but with Selenium2TestCase::currentScreenshot() it is fetched to the local environment where the tests are executed from?

jeffery avatar Jul 09 '12 01:07 jeffery

Yes; in Selenium 2 the Json Wire Protocol provides the screenshot as a BLOB accessible through a GET request, and it is fetched before closing the session.

giorgiosironi avatar Jul 09 '12 09:07 giorgiosironi

Thanks mate

jeffery avatar Jul 09 '12 23:07 jeffery

+1

neoascetic avatar Mar 20 '14 03:03 neoascetic