You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to make phpunt-selenium work with Selenium Webdriver 3 + Firefox + Geckodriver, is phpunit-selenium comptabile ?
php : 7.0
phpunit : 6.5.12
phpunit-selenium : 4.1.0
geckodriver : 0.19 (or 0.21)
Firefox : 57.0.4
I mange to connect Phpunit and Geckodriver/Firefox, open a page with $this->url(), but when doing $this->byCssSelector('DIV'), i got an Exception :
InvalidArgumentException: Element not found.
vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/Selenium2TestCase/Element.php:82
vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/Selenium2TestCase/Element/Accessor.php:136
vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/Selenium2TestCase/Element/Accessor.php:175
vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/Selenium2TestCase/Element/Accessor.php:72
vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/Selenium2TestCase.php:416
After investigating, (geckodriver log + var_dump in vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/Selenium2TestCase/Element.php:82), geckodriver returns a response :
But I solved 95% of my problems by changing method fromResponseValue in Element.php. It's trying to get ELEMENT value (Selenium Format) or a key beginning with 'element' (W3C WebDriver format for geckodriver)
public static function fromResponseValue(
array $value,
PHPUnit_Extensions_Selenium2TestCase_URL $parentFolder,
PHPUnit_Extensions_Selenium2TestCase_Driver $driver)
{
$key = false;
if (!isset($value['ELEMENT'])) {
foreach ($value as $lKey => $val) {
if (substr($lKey,0,7) === "element") {
$key = $lKey;
break;
}
}
if (! $key) {
throw new InvalidArgumentException('Element not found.');
}
} else {
$key = "ELEMENT";
}
$url = $parentFolder->descend($value[$key]);
return new self($driver, $url);
}
nerville
added a commit
to fusionforge/fusionforge
that referenced
this issue
May 15, 2019
Hello,
I'm trying to make phpunt-selenium work with Selenium Webdriver 3 + Firefox + Geckodriver, is phpunit-selenium comptabile ?
php : 7.0
phpunit : 6.5.12
phpunit-selenium : 4.1.0
geckodriver : 0.19 (or 0.21)
Firefox : 57.0.4
I mange to connect Phpunit and Geckodriver/Firefox, open a page with $this->url(), but when doing $this->byCssSelector('DIV'), i got an Exception :
After investigating, (geckodriver log + var_dump in vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/Selenium2TestCase/Element.php:82), geckodriver returns a response :
an Element.php is waiting for array["ELEMENT"]
(see mozilla/geckodriver#391)
So i think it's not compatible with geckodriver and Selenium 3 + Firefox ?
The text was updated successfully, but these errors were encountered: