當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。