本文整理汇总了PHP中SeleniumClient\By::getStrategy方法的典型用法代码示例。如果您正苦于以下问题:PHP By::getStrategy方法的具体用法?PHP By::getStrategy怎么用?PHP By::getStrategy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SeleniumClient\By
的用法示例。
在下文中一共展示了By::getStrategy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: webElementFindElements
/**
* 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;
}