当前位置: 首页>>代码示例>>PHP>>正文


PHP By::XPath方法代码示例

本文整理汇总了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));
 }
开发者ID:klas,项目名称:joomla-cms,代码行数:28,代码来源:ArticleManagerPage.php


注:本文中的SeleniumClient\By::XPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。