Error:
FacebookWebDriverExceptionInternalUnexpectedResponseException: Error taking screenshot, no data received from the remote end
/path/to/app/vendor/php-webdriver/webdriver/lib/Exception/Internal/UnexpectedResponseException.php:14
/path/to/app/vendor/php-webdriver/webdriver/lib/Support/ScreenshotHelper.php:48
/path/to/app/vendor/php-webdriver/webdriver/lib/Support/ScreenshotHelper.php:33
/path/to/app/vendor/php-webdriver/webdriver/lib/Remote/RemoteWebDriver.php:381
Code that is run upon test failure:
protected function setUp(): void
{
// Start a browser session
$capabilities = DesiredCapabilities::microsoftEdge();
// Set the options in the capabilities
$capabilities->setCapability('platformName', 'linux');
$this->driver = RemoteWebDriver::create('http://selenium:4444/wd/hub', $capabilities);
}
...
protected function onNotSuccessfulTest(Throwable $t): void
{
$x = $this->driver->takeScreenshot();
file_put_contents('/path/to/app/test.png', $x);
}