/** * @return string * @throws WebDriverException */ public function getID() { try { return $this->element->getID(); } catch (WebDriverException $exception) { $this->dispatchOnException($exception); } }
/** * Switch to the iframe by its id or name. * * @param WebDriverElement|string $frame The WebDriverElement, the id or the name of the frame. * @return WebDriver The driver focused on the given frame. */ public function frame($frame) { if ($frame instanceof WebDriverElement) { $id = array('ELEMENT' => $frame->getID()); } else { $id = (string) $frame; } $params = array('id' => $id); $this->executor->execute(DriverCommand::SWITCH_TO_FRAME, $params); return $this->driver; }
/** * Test if two element IDs refer to the same DOM element. * * @param WebDriverElement $other * @return bool */ public function equals(WebDriverElement $other) { return $this->executor->execute(DriverCommand::ELEMENT_EQUALS, array(':id' => $this->id, ':other' => $other->getID())); }
/** * @param WebDriverElement $element * @param int $xoffset * @param int $yoffset * * @return RemoteTouchScreen The instance. */ public function scrollFromElement(WebDriverElement $element, $xoffset, $yoffset) { $this->executor->execute(DriverCommand::TOUCH_SCROLL, array('element' => $element->getID(), 'xoffset' => $xoffset, 'yoffset' => $yoffset)); return $this; }