本文整理匯總了PHP中SeleniumClient\By::XPath方法的典型用法代碼示例。如果您正苦於以下問題:PHP By::XPath方法的具體用法?PHP By::XPath怎麽用?PHP By::XPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SeleniumClient\By
的用法示例。
在下文中一共展示了By::XPath方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: doBatchAction
/**
* Function that does Batch Process for Articles, Copy, Move articles
*
* @param string $articleName Article for which Batch Processing is to be done
* @param string $searchString Value entered in the drop down to filter the results
* @param string $newCategory Category to which the Article is to be moved or copied
* @param string $action Action to be taken, either Move or Copy
*
* @return void
*/
public function doBatchAction($articleName, $searchString, $newCategory, $action)
{
$this->searchFor($articleName);
$row = $this->getRowNumber($articleName);
$this->driver->findElement(By::xPath("//input[@id='cb" . ($row - 1) . "']"))->click();
$this->clickButton('toolbar-batch');
$this->driver->waitForElementUntilIsPresent(By::xPath("//div[@class='modal hide fade in']"));
$this->driver->findElement(By::xPath("//div[@id='batch_category_id_chzn']/a"))->click();
$this->driver->findElement(By::xPath("//div[@id='batch_category_id_chzn']/div/div/input"))->sendKeys($searchString);
$this->driver->findElement(By::xPath("//div[@id='batch_category_id_chzn']//ul[@class = 'chzn-results']/li[contains(.,'" . $newCategory . "')]"))->click();
if (strtolower($action) == 'copy') {
$this->driver->findElement(By::xPath("//input[@id='batch[move_copy]c']"))->click();
} else {
$this->driver->findElement(By::XPath("//input[@id='batch[move_copy]m']"))->click();
}
$this->driver->findElement(By::xPath("//button[contains(text(),'Process')]"))->click();
$this->driver->waitForElementUntilIsPresent(By::xPath($this->waitForXpath));
}