Skip to content

Commit b5b18bd

Browse files
mvorisekrobocoder
authored andcommitted
Fix compatibility with Selenium 2.x
1 parent 623eb02 commit b5b18bd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/WebDriver/Session.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,13 @@ private function serializeArguments(array $arguments)
476476
foreach ($arguments as $key => $value) {
477477
// Potential compat-buster, i.e., W3C-specific
478478
if ($value instanceof Element) {
479-
$arguments[$key] = [Container::WEBDRIVER_ELEMENT_ID => $value->getID()];
479+
// preferably we want to detect W3C support and never set nor parse
480+
// LEGACY_ELEMENT_ID, until detection is implemented, serialize to both
481+
// variants, tested with Selenium v2.53.1 and v3.141.59
482+
$arguments[$key] = [
483+
Container::WEBDRIVER_ELEMENT_ID => $value->getID(),
484+
Container::LEGACY_ELEMENT_ID => $value->getID(),
485+
];
480486
continue;
481487
}
482488

0 commit comments

Comments
 (0)