本文整理汇总了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));
}