當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WebDriverBy::XPath方法代碼示例

本文整理匯總了PHP中WebDriverBy::XPath方法的典型用法代碼示例。如果您正苦於以下問題:PHP WebDriverBy::XPath方法的具體用法?PHP WebDriverBy::XPath怎麽用?PHP WebDriverBy::XPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WebDriverBy的用法示例。


在下文中一共展示了WebDriverBy::XPath方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testHelpEditorPermission

 /**
  * Tests that help editor loads with the permission
  *
  * @return void
  */
 function testHelpEditorPermission()
 {
     $this->setupPermissions(array("context_help"));
     $this->safeGet($this->url . "/help_editor/");
     $bodyText = $this->safeFindElement(WebDriverBy::XPath("//*[@id='lorisworkspace']/table/tbody/tr/td[1]"))->getText();
     $this->assertContains("List of Topics", $bodyText);
     $this->resetPermissions();
 }
開發者ID:spaiva,項目名稱:Loris,代碼行數:13,代碼來源:help_editorTest.php

示例2: testSearchUnresolvedConflicts

 /**
  * Tests research function in unresolved conflicts
  * author: Wang Shen
  *
  * @return void
  */
 function testSearchUnresolvedConflicts()
 {
     $this->safeGet($this->url . "/conflict_resolver/");
     $keywordElement = $this->webDriver->findElement(WebDriverBy::Name("Question"));
     $keywordElement->sendkeys('TestTestTest');
     //click show data button
     $this->webDriver->findElement(WebDriverBy::ID("testShowData1"))->click();
     $bodyText = $this->webDriver->findElement(WebDriverBy::XPath("//*[@id='conflict_resolver']/div/div/div/" . "table/tbody/tr[1]/td[6]"))->getText();
     $this->assertContains("TestTestTest", $bodyText);
 }
開發者ID:spaiva,項目名稱:Loris,代碼行數:16,代碼來源:conflict_resolverTest.php

示例3: testGeneralDescriptionTabLoads

 public function testGeneralDescriptionTabLoads()
 {
     $this->webDriver->get($this->url . '?test_name=statistics&subtest=stats_general&dynamictabs=dynamictabs');
     $header = $this->webDriver->findElement(WebDriverBy::XPath("//div[@id = 'page']/h2"));
     $this->assertContains("Welcome to the statistics page", $header->getText());
 }
開發者ID:frankbiospective,項目名稱:Loris,代碼行數:6,代碼來源:Statistics_Test.php

示例4: testDashboardRecruitmentView

 /**
  * To test that, when loading the Dashboard, click the Views button of
  * Recruitment, the items "View overall recruitment" and "View site breakdown"
  * appear
  * author : Wang Shen
  *
  * @return void
  */
 public function testDashboardRecruitmentView()
 {
     $this->safeGet($this->url . '/dashboard/');
     $views = $this->webDriver->findElement(WebDriverBy::Xpath("//*[@id='lorisworkspace']/div/di" . "v[1]/div[2]/div[1]/div/div/button"));
     $views->click();
     $assertText1 = $this->webDriver->findElement(WebDriverBy::XPath("//*[@id='lorisworkspace']/div/div[1]" . "/div[2]/div[1]/div/div/ul/li[1]/a"))->getText();
     $assertText2 = $this->webDriver->findElement(WebDriverBy::XPath("//*[@id='lorisworkspace']/div/div[1]" . "/div[2]/div[1]/div/div/ul/li[2]/a"))->getText();
     $this->assertContains("View overall recruitment", $assertText1);
     $this->assertContains("View site breakdown", $assertText2);
 }
開發者ID:spaiva,項目名稱:Loris,代碼行數:18,代碼來源:DashboardTest.php


注:本文中的WebDriverBy::XPath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。