diff --git a/lib/WebDriver/Container.php b/lib/WebDriver/Container.php index be1cfa7..fc698e0 100644 --- a/lib/WebDriver/Container.php +++ b/lib/WebDriver/Container.php @@ -32,6 +32,9 @@ */ abstract class Container extends AbstractWebDriver { + const LEGACY_ELEMENT_ID = 'ELEMENT'; + const WEBDRIVER_ELEMENT_ID = 'element-6066-11e4-a52e-4f735466cecf'; + /** * {@inheritdoc} */ @@ -203,12 +206,19 @@ public function locate($using, $value) */ protected function webDriverElement($value) { - return array_key_exists('ELEMENT', (array) $value) - ? new Element( - $this->getElementPath($value['ELEMENT']), // url - $value['ELEMENT'] // id - ) - : null; + if (array_key_exists(self::LEGACY_ELEMENT_ID, (array) $value)) { + return new Element( + $this->getElementPath($value[self::LEGACY_ELEMENT_ID]), // url + $value[self::LEGACY_ELEMENT_ID] // id + ); + } + + if (array_key_exists(self::WEBDRIVER_ELEMENT_ID, (array) $value)) { + return new Element( + $this->getElementPath($value[self::WEBDRIVER_ELEMENT_ID]), // url + $value[self::WEBDRIVER_ELEMENT_ID] // id + ); + } } /**