A
A
Alexander Sharihin2015-04-22 17:19:20
PHP
Alexander Sharihin, 2015-04-22 17:19:20

PHP+Selenium+RemoteWebDriver(FireFox) how to get Screenshot?

Good afternoon!
Given:

  • Solution in PHP
  • $driver object created like this:
    $host         = 'http://localhost:4444/wd/hub'; // this is the default
        $capabilities = array(WebDriverCapabilityType::BROWSER_NAME => WebDriverBrowserType::FIREFOX);
        $driver       = new RemoteWebDriver($host, $capabilities);

  • Inability to opt out of PHP and RemoteWebDriver

You need to take a screenshot to understand what went wrong.
$driver->screenshot('/home/g*****/web/g*******/public_html/screen.jpg');

It just destroys the execution of the script (there are write rights to the folder).

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Max, 2015-04-22
@Pinsky

Are you sure you have a screenshot() function?
https://github.com/facebook/php-webdriver/blob/mas...
Well, look how exactly your script collapses

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question