/** * Move to a frame element. * @param WebElement $frameElement * @return current WebDriver */ public function getFrameByWebElement(WebElement $frameElement) { //We should validate that frameElement is string /* if (frameElement == null) { throw new ArgumentNullException("frameElement", "Frame element cannot be null"); } RemoteWebElement convertedElement = frameElement as RemoteWebElement; if (convertedElement == null) { throw new ArgumentException("frameElement cannot be converted to RemoteWebElement", "frameElement"); } */ $frameId = $frameElement->getElementId(); $target = array('ELEMENT' => $frameId); $this->_driver->getFrame($target); return $this->_driver; }
/** * Test if two element refer to the same DOM element. * @param WebElement $webElementCompare * @return boolean */ public function compareToOther(WebElement $webElementCompare) { $params = array('element_id' => $this->getElementId(), 'element_id_compare' => $webElementCompare->getElementId()); $command = new Commands\Command($this->_driver, 'compare_to_other', null, $params); $results = $command->execute(); return trim($results['value']) == "1"; }