本文整理汇总了PHP中WebDriverBy::linkText方法的典型用法代码示例。如果您正苦于以下问题:PHP WebDriverBy::linkText方法的具体用法?PHP WebDriverBy::linkText怎么用?PHP WebDriverBy::linkText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebDriverBy
的用法示例。
在下文中一共展示了WebDriverBy::linkText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: goToNextResultPage
/**
* Go to next result page
*/
public function goToNextResultPage()
{
$i = $this->actor;
$i->executeInSelenium(function (\RemoteWebDriver $webDriver) {
$webDriver->findElement(\WebDriverBy::linkText('Next'))->click();
});
}
示例2: click_product_by_link_text
/**
* Поиск продукта по названию и переход на страницу
* @param String $link_text
* @return Page_Product
*/
public function click_product_by_link_text($link_text)
{
$wait = new WebDriverWait($this->web_driver, 30);
$wait->until(WebDriverExpectedCondition::visibilityOfElementLocated(WebDriverBy::linkText($link_text)));
$this->web_driver->findElement(WebDriverBy::linkText($link_text))->click();
return new Page_Product($this->web_driver);
}
示例3: ensureTreeNodeIsOpen
/**
* Search for an element with the given link text in the provided context.
*
* @param string $nodeText
* @param RemoteWebElement $context
* @return RemoteWebElement
*/
protected function ensureTreeNodeIsOpen(string $nodeText, RemoteWebElement $context)
{
$I = $this->tester;
$I->see($nodeText, self::$treeItemSelector);
/** @var RemoteWebElement $context */
$context = $I->executeInSelenium(function () use($nodeText, $context) {
return $context->findElement(\WebDriverBy::linkText($nodeText))->findElement(WebDriverBy::xpath('ancestor::li[@class="x-tree-node"][1]'));
});
try {
$context->findElement(\WebDriverBy::cssSelector('.x-tree-elbow-end-plus'))->click();
} catch (\Facebook\WebDriver\Exception\NoSuchElementException $e) {
// element not found so it may be already opened...
}
return $context;
}
示例4: testLogInAndOut
public function testLogInAndOut()
{
$this->driver->get('http://localhost:80/addons/boards.php');
$button = $this->driver->findElement(WebDriverBy::id("navcontent"))->findElement(WebDriverBy::linkText("Log In"));
$button->click();
$this->assertContains("login.php", $this->driver->getCurrentURL());
//$element1 = $this->driver->getActiveElement();
$element1 = $this->driver->findElement(WebDriverBy::name("username"));
$this->assertEquals("input", $element1->getTagName());
//$this->assertEquals("username", $element1->getAttribute("name"));
$element1->sendKeys("4833");
//$element1->sendKeys(KEYS::TAB);
//$element2 = $this->driver->getActiveElement();
$element2 = $this->driver->findElement(WebDriverBy::name("password"));
$this->assertEquals("input", $element1->getTagName());
//$this->assertEquals("password", $element1->getAttribute("name"));
$element2->sendKeys("asdf");
$title = $this->driver->getTitle();
$element2->submit();
$this->driver->wait(5, 250)->until(WebDriverExpectedCondition::not(WebDriverExpectedCondition::titleIs($title)));
$this->assertContains("boards.php", $this->driver->getCurrentURL());
}
示例5: adminChangeProgramVUD
/**
* @param $start_time
* The timestamp on the user ID we are modifying the program for
* @param $time_change
* $time parameter passed to strtotime
*/
public function adminChangeProgramVUD($start_time, $time_change)
{
$this->webDriver->get($this->url . '/admin/structure/entity-type/checklist/accredited');
Automation::grabElementByCssSelector($this->webDriver, '.pager-last > a:nth-child(1)')->click();
// Page to last page
// And then all of this to wait for the list to refresh...
$this->webDriver->wait(3, 500)->until(WebDriverExpectedCondition::presenceOfElementLocated(WebDriverBy::cssSelector('.pager-first')));
$link = $this->webDriver->findElement(WebDriverBy::linkText("Checklist Accredited | Webdriver Program {$start_time}"));
$link->click();
$edit_url = $this->webDriver->getCurrentURL() . '/edit';
$this->webDriver->get($edit_url);
$vud_box = Automation::grabElementByCssSelector($this->webDriver, '#edit-field-accreditation-valid-until-und-0-value-date');
$vud = $vud_box->getAttribute('value');
$vud_date = strtotime($vud);
$minus1year = strtotime($time_change, $vud_date);
$minus1year_text = date('M d Y', $minus1year);
$vud_box->clear();
$vud_box->sendKeys($minus1year_text);
$submit = Automation::grabElementByCssSelector($this->webDriver, '#edit-submit');
$submit->click();
}
示例6: goToForm
public function goToForm($link_text)
{
$this->webDriver->get($this->url);
// Go Home first
$link = $this->webDriver->findElement(WebDriverBy::linkText($link_text));
$link->click();
}
示例7: tearDown
public function tearDown()
{
self::$webDriver->findElement(WebDriverBy::linkText('Abmelden'))->click();
self::$webDriver->findElement(WebDriverBy::linkText('Bei ILIAS anmelden'))->click();
}
示例8: getWebDriverLocator
protected function getWebDriverLocator(array $by)
{
$type = key($by);
$locator = $by[$type];
switch ($type) {
case 'id':
return \WebDriverBy::id($locator);
case 'name':
return \WebDriverBy::name($locator);
case 'css':
return \WebDriverBy::cssSelector($locator);
case 'xpath':
return \WebDriverBy::xpath($locator);
case 'link':
return \WebDriverBy::linkText($locator);
case 'class':
return \WebDriverBy::className($locator);
default:
throw new TestRuntime("Locator type '{$by}' is not defined. Use either: xpath, css, id, link, class, name");
}
}
示例9: findLinkByText
/**
* Find a link by its text
* @param $text
* @return mixed
* @throws NoSuchElementException
*/
public function findLinkByText($text)
{
return $this->driver->findElement(WebDriverBy::linkText($text));
}
示例10: iPressPricing
/**
* @When /^I press pricing$/
*/
public function iPressPricing()
{
$element = $this->getSession()->findElement(WebDriverBy::linkText("pricing"))->click();
}
示例11: acessarAdministracao
public function acessarAdministracao($driver)
{
$this->driver->findElement(WebDriverBy::linkText("Gerenciar módulos"))->click();
return $this->driver;
}
示例12: deleteFirstBooking
/**
* Deletes the first booking
*/
public function deleteFirstBooking()
{
$this->webDriver->findElement(WebDriverBy::linkText('Stornieren'))->click();
$this->webDriver->findElement(WebDriverBy::name('cmd[cancelBooking]'))->click();
}
示例13: tearDownAfterClass
/**
* Closes web browser.
*/
public static function tearDownAfterClass()
{
self::$helper->login(self::$login_root, self::$pass_root);
self::$helper->toRSS();
self::$helper->deleteAllRooms();
self::$webDriver->findElement(WebDriverBy::linkText('Privilegien'))->click();
self::$webDriver->findElement(WebDriverBy::partialLinkText(self::$classname_1))->click();
self::$webDriver->findElement(WebDriverBy::partialLinkText('Klasse löschen'))->click();
self::$webDriver->findElement(WebDriverBy::name('cmd[deleteClass]'))->click();
self::$webDriver->findElement(WebDriverBy::linkText('Privilegien'))->click();
self::$webDriver->findElement(WebDriverBy::partialLinkText(self::$classname_2))->click();
self::$webDriver->findElement(WebDriverBy::partialLinkText('Klasse löschen'))->click();
self::$webDriver->findElement(WebDriverBy::name('cmd[deleteClass]'))->click();
self::$helper->deleteUser();
self::$helper->toRSS();
self::$helper->deleteUser();
self::$helper->logout();
self::$webDriver->quit();
}
示例14: getGrpIdByName
/**
* get ILIAS id by name of ILIAS group
* @param type $name
*/
private function getGrpIdByName($name)
{
$pool = self::$webDriver->findElement(WebDriverBy::linkText($name));
$pool2 = $pool->getAttribute("href");
$pos = strpos($pool2, "id=");
return substr($pool2, $pos + 3, -75);
}
示例15: getStrictLocator
/**
* @param array $by
* @return \WebDriverBy
*/
protected function getStrictLocator(array $by)
{
$type = key($by);
$locator = $by[$type];
switch ($type) {
case 'id':
return \WebDriverBy::id($locator);
case 'name':
return \WebDriverBy::name($locator);
case 'css':
return \WebDriverBy::cssSelector($locator);
case 'xpath':
return \WebDriverBy::xpath($locator);
case 'link':
return \WebDriverBy::linkText($locator);
case 'class':
return \WebDriverBy::className($locator);
default:
throw new MalformedLocatorException("{$by} => {$locator}", "Strict locator can be either xpath, css, id, link, class, name: ");
}
}