Codeception: instance of Facebook\WebDriver\Remote\RemoteWebDriver given

Created on 8 Sep 2015  路  3Comments  路  Source: Codeception/Codeception

Hi,

i run

// Example 2: background colour, element found with CSS
$bar = $I->executeInSelenium(function(\WebDriver $webdriver) {
return $webdriver->findElement(WebDriverBy::cssSelector('h3'))->getCSSValue('background-color');
});

And got this error
[PHPUnit_Framework_Exception] Argument 1 passed to Codeception\TestCase\Cept::{closure}() must be an instance of WebDriver, instance of Facebook\WebDriver\Remote\RemoteWebDriver given, called in /pathtoproject/vendor/codeception/codeception/src/Codeception/Module/WebDriver.php on line 1651 and defined

Fixed it with rollback on 2.1.0

Hope that helps. Stay strong good work ;)

Most helpful comment

Just replace

function(\WebDriver $webdriver) {

with

function(\Facebook\WebDriver\Remote\RemoteWebDriver $webdriver)

All 3 comments

Just replace

function(\WebDriver $webdriver) {

with

function(\Facebook\WebDriver\Remote\RemoteWebDriver $webdriver)

Thx

Thanks!! :)

Was this page helpful?
0 / 5 - 0 ratings