function Element::shadow
Get element shadow root: /session/:sessionId/element/:elementId/shadow
shadow root method chaining, e.g.,
- $element->method()
Return value
\WebDriver\Shadow|null
File
-
vendor/
lullabot/ php-webdriver/ lib/ WebDriver/ Element.php, line 127
Class
- Element
- WebDriver\Element class
Namespace
WebDriverCode
public function shadow() {
$result = $this->curl('POST', '/shadow');
$value = $result['value'];
if (array_key_exists(Shadow::SHADOW_ROOT_ID, (array) $value)) {
$shadowRootReference = $value[Shadow::SHADOW_ROOT_ID];
return new Shadow(preg_replace('/' . preg_quote('element/' . $this->id, '/') . '$/', '/', $this->url), $shadowRootReference);
}
return null;
}