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