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


PHP WebDriverBy::linkText方法代码示例

本文整理汇总了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();
     });
 }
开发者ID:aishwarya-murthy,项目名称:GoEuro,代码行数:10,代码来源:ResultsPage.php

示例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);
 }
开发者ID:puha4,项目名称:tuscany-selenium-parser,代码行数:12,代码来源:Page_Category.php

示例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;
 }
开发者ID:dachcom-digital,项目名称:TYPO3.CMS,代码行数:22,代码来源:PageTree.php

示例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());
 }
开发者ID:hoff121324,项目名称:GlassWebsite,代码行数:22,代码来源:interfaceTest.php

示例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();
 }
开发者ID:jamesrward,项目名称:fvdmug_selenium,代码行数:27,代码来源:programtest.php

示例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();
 }
开发者ID:jamesrward,项目名称:fvdmug_selenium,代码行数:7,代码来源:WebformTest.php

示例7: tearDown

 public function tearDown()
 {
     self::$webDriver->findElement(WebDriverBy::linkText('Abmelden'))->click();
     self::$webDriver->findElement(WebDriverBy::linkText('Bei ILIAS anmelden'))->click();
 }
开发者ID:studer-raimann,项目名称:RoomSharing,代码行数:5,代码来源:ilRoomSharingAcceptanceFloorPlansTest.php

示例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");
     }
 }
开发者ID:Eli-TW,项目名称:Codeception,代码行数:21,代码来源:WebDriver.php

示例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));
 }
开发者ID:passbolt,项目名称:passbolt_selenium,代码行数:10,代码来源:WebDriverTestCase.php

示例10: iPressPricing

 /**
  * @When /^I press pricing$/
  */
 public function iPressPricing()
 {
     $element = $this->getSession()->findElement(WebDriverBy::linkText("pricing"))->click();
 }
开发者ID:patshay,项目名称:SauceLabsTest,代码行数:7,代码来源:FeatureContext.php

示例11: acessarAdministracao

 public function acessarAdministracao($driver)
 {
     $this->driver->findElement(WebDriverBy::linkText("Gerenciar módulos"))->click();
     return $this->driver;
 }
开发者ID:adrielcardoso,项目名称:TDD_Exemplo_phpunit,代码行数:5,代码来源:SiteTest.php

示例12: deleteFirstBooking

 /**
  * Deletes the first booking
  */
 public function deleteFirstBooking()
 {
     $this->webDriver->findElement(WebDriverBy::linkText('Stornieren'))->click();
     $this->webDriver->findElement(WebDriverBy::name('cmd[cancelBooking]'))->click();
 }
开发者ID:studer-raimann,项目名称:RoomSharing,代码行数:8,代码来源:ilRoomSharingAcceptanceSeleniumHelper.php

示例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();
 }
开发者ID:studer-raimann,项目名称:RoomSharing,代码行数:22,代码来源:ilRoomSharingAcceptancePrivilegeTest.php

示例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);
 }
开发者ID:studer-raimann,项目名称:RoomSharing,代码行数:11,代码来源:ilRoomSharingAcceptanceRSSPoolTest.php

示例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: ");
     }
 }
开发者ID:RobertWang,项目名称:Codeception,代码行数:25,代码来源:WebDriver.php


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