Example #1
0
 /**
  * @return string
  * @throws WebDriverException
  */
 public function getID()
 {
     try {
         return $this->element->getID();
     } catch (WebDriverException $exception) {
         $this->dispatchOnException($exception);
     }
 }
Example #2
0
 /**
 * 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()));
 }
Example #4
0
 /**
  * @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;
 }