/** * Find elements within another element * @param Integer $elementId * @param By $locator * @param Boolean $polling * @return \SeleniumClient\WebElement */ public function webElementFindElements($elementId, By $locator, $polling = false) { $command = "elements"; $params = array('using' => $locator->getStrategy(), 'value' => $locator->getSelectorValue()); $urlHubFormatted = $this->_hubUrl . "/session/{$this->_sessionId}/element/{$elementId}/{$command}"; $httpClient = HttpFactory::getClient($this->_environment); $results = $httpClient->setUrl($urlHubFormatted)->setHttpMethod(HttpClient::POST)->setJsonParams($params)->setPolling($polling)->execute(); $result = null; if (isset($results["value"]) && is_array($results["value"])) { $webElements = array(); foreach ($results["value"] as $element) { $webElements[] = new WebElement($this, $element["ELEMENT"]); } $result = $webElements; } return $result; }