diff --git a/lib/WebDriver/Session.php b/lib/WebDriver/Session.php index d4b3268..f73e379 100644 --- a/lib/WebDriver/Session.php +++ b/lib/WebDriver/Session.php @@ -476,7 +476,13 @@ private function serializeArguments(array $arguments) foreach ($arguments as $key => $value) { // Potential compat-buster, i.e., W3C-specific if ($value instanceof Element) { - $arguments[$key] = [Container::WEBDRIVER_ELEMENT_ID => $value->getID()]; + // preferably we want to detect W3C support and never set nor parse + // LEGACY_ELEMENT_ID, until detection is implemented, serialize to both + // variants, tested with Selenium v2.53.1 and v3.141.59 + $arguments[$key] = [ + Container::WEBDRIVER_ELEMENT_ID => $value->getID(), + Container::LEGACY_ELEMENT_ID => $value->getID(), + ]; continue; }