Skip to content

Commit

Permalink
Fix compatibility with Selenium 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek authored and robocoder committed Apr 19, 2022
1 parent 623eb02 commit b5b18bd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/WebDriver/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit b5b18bd

Please sign in to comment.