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


PHP WebDriverBy::ID方法代码示例

本文整理汇总了PHP中WebDriverBy::ID方法的典型用法代码示例。如果您正苦于以下问题:PHP WebDriverBy::ID方法的具体用法?PHP WebDriverBy::ID怎么用?PHP WebDriverBy::ID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WebDriverBy的用法示例。


在下文中一共展示了WebDriverBy::ID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testTabsFrameworkLoads

 public function testTabsFrameworkLoads()
 {
     $this->webDriver->get($this->url . '?test_name=statistics');
     try {
         // If this is the mobile view, we need to expand the dropdown
         // before the stats links are visible.
         $expand = $this->webDriver->findElement(WebDriverBy::ID("down"));
         $expand->click();
     } catch (ElementNotVisibleException $e) {
         // Using the desktop version, so the mobile link isn't visible and
         // doesn't need to be clicked.
     }
     // Ensure that Demographic Statistics link is there. There's nothing special
     // about Demographics, it's just a randomly chosen default tab to ensure that
     // something shows up. Ideally, this should loop through the StatisticsTabs
     // table and ensure that they all appear.
     try {
         $link = $this->webDriver->findElement(WebDriverBy::PartialLinkText("Demographic Statistics"));
         $this->assertContains("Demographic", $link->getText());
     } catch (NoSuchElementException $e) {
         print $this->webDriver->getPageSource();
         $this->fail("Could not find demographic tab link");
     }
 }
开发者ID:frankbiospective,项目名称:Loris,代码行数:24,代码来源:Statistics_Test.php

示例2: testClearFormResolvedConflicts

 /**
  * Tests Clear Form function in resolved conflicts
  * author: Wang Shen
  *
  * @return void
  */
 function testClearFormResolvedConflicts()
 {
     $this->safeGet($this->url . "/conflict_resolver/?submenu=resolved_conflicts");
     $keywordElement = $this->webDriver->findElement(WebDriverBy::Name("Question"));
     $keywordElement->sendkeys('TestTestTest');
     //click clear form button
     $this->webDriver->findElement(WebDriverBy::ID("testClearForm1"))->click();
     $bodyText = $this->webDriver->findElement(WebDriverBy::Name("Question"))->getText();
     $this->assertNotContains("TestTestTest", $bodyText);
 }
开发者ID:spaiva,项目名称:Loris,代码行数:16,代码来源:conflict_resolverTest.php


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