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


PHP By::tagName方法代码示例

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


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

示例1: getModuleTitles

 /**
  * Gets the titles of modules in sliders
  *
  * @return  array of stdClass objects
  */
 public function getModuleTitles()
 {
     $container = $this->driver->findElement(By::Id('panel-sliders'));
     $elements = $container->findElements(By::tagName('h3'));
     $return = array();
     foreach ($elements as $element) {
         $object = new stdClass();
         $object->text = $element->getText();
     }
 }
开发者ID:rasiodesign,项目名称:joomla-cms,代码行数:15,代码来源:ControlPanelPage.php

示例2: getMenuItemTypes

 /**
  * function to get all menu types
  *
  * @return array
  */
 public function getMenuItemTypes()
 {
     $result = array();
     $d = $this->driver;
     $d->findElement(By::xPath("//a[contains(@onclick, 'option=com_menus&view=menutypes')]"))->click();
     $el = $d->waitForElementUntilIsPresent(By::xPath("//iframe[contains(@src, 'option=com_menus&view=menutypes')]"));
     $el = $d->switchTo()->getFrameByWebElement($el);
     $groups = $d->findElements(By::className('accordion-group'));
     foreach ($groups as $group) {
         $toggle = $group->findElement(By::className('accordion-toggle'));
         $toggleName = $toggle->getText();
         $toggle->click();
         $d->waitForElementUntilIsPresent(By::xPath("//div[contains(@class, 'accordion-body in')]/div/ul/li/a"));
         $menuTypes = $el->findElements(By::xPath("//div[contains(@class, 'accordion-body in')]/div/ul/li/a"));
         foreach ($menuTypes as $menuType) {
             $allText = $menuType->getText();
             $subTextLength = strlen($menuType->findElement(By::tagName('small'))->getText());
             $menuTypeText = substr($allText, 0, strlen($allText) - $subTextLength);
             $result[] = array('group' => $toggleName, 'type' => $menuTypeText);
         }
     }
     return $result;
 }
开发者ID:klas,项目名称:joomla-cms,代码行数:28,代码来源:MenuItemEditPage.php

示例3: getVisibleMenuLinks

 /**
  * Gets array of visible links in the menu container
  * This is normally the header menu for back-end manager screens
  *
  * @return  array of stdClass objects
  */
 public function getVisibleMenuLinks()
 {
     $menuContainer = $this->driver->findElement(By::id('menu'));
     $menus = $menuContainer->findElements(By::tagName('a'));
     $return = array();
     foreach ($menus as $menu) {
         if ($text = $menu->getText()) {
             $menuObject = new stdClass();
             $menuObject->text = $text;
             $menuObject->href = $menu->getAttribute('href');
             $menuObject->id = $menu->getElementId();
             $return[] = $menuObject;
         }
     }
     return $return;
 }
开发者ID:rasiodesign,项目名称:joomla-cms,代码行数:22,代码来源:AdminPage.php

示例4: toWikiHelpSelect

 /**
  * Prepare wiki text for an option group
  * Format is: *'''<label>:''' (<option1>/<option2/..) <tooltip text>
  */
 public function toWikiHelpSelect(stdClass $object)
 {
     $optionContainer = $this->driver->findElement(By::xPath("//div[@id='" . $object->id . "_chzn']"));
     $optionContainer->click();
     $optionList = $optionContainer->findElement(By::tagName('ul'));
     $optionText = $this->getOptionText($optionList);
     return "*'''" . $object->labelText . ":''' (" . implode('/', $optionText) . "). " . $this->getToolTip($object->tab, $object->id) . "\n";
 }
开发者ID:ryanshowers,项目名称:joomla-cms,代码行数:12,代码来源:AdminEditPage.php

示例5: toWikiHelpPermissions

 /**
  * Prepare wiki text for permissions tab
  *
  */
 public function toWikiHelpPermissions($groupId)
 {
     $objects = $this->getPermissionInputFields($groupId);
     foreach ($objects as $object) {
         $listElement = str_replace('.', '_', $object->id);
         $optionContainer = $this->driver->findElement(By::xPath("//div[@id='" . $listElement . "_chzn']"));
         $optionContainer->findElement(By::tagName('a'))->click();
         $optionList = $optionContainer->findElement(By::tagName('ul'));
         $optionText = $this->getOptionText($optionList);
         $toolTip = $object->element->getAttribute('title') . ". " . $object->tipText;
         $helpText[] = "*'''" . $object->labelText . ":''' (" . implode('/', $optionText) . "). " . $toolTip . "\n";
         $optionContainer->findElement(By::tagName('a'))->click();
     }
     return $helpText;
 }
开发者ID:karimzg,项目名称:joomla,代码行数:19,代码来源:GlobalConfigurationPage.php

示例6: testFindElements

 public function testFindElements()
 {
     $this->_driver->get($this->_url);
     $webElements = $this->_driver->findElements(By::tagName("input"));
     foreach ($webElements as $webElement) {
         $this->assertTrue($webElement instanceof WebElement);
     }
     $this->assertTrue(is_array($webElements));
     $this->assertTrue(count($webElements) > 0);
 }
开发者ID:ron-inbar,项目名称:PHP-SeleniumClient,代码行数:10,代码来源:WebDriverTest.php

示例7: getRowText

 public function getRowText($name)
 {
     $result = false;
     $rowElements = $this->driver->findElement(By::xPath("//tbody"))->findElements(By::tagName('tr'));
     $count = count($rowElements);
     for ($i = 0; $i < $count; $i++) {
         $rowText = $rowElements[$i]->getText();
         if (strpos($rowText, $name) !== false) {
             $result = $rowText;
             break;
         }
     }
     return $result;
 }
开发者ID:klas,项目名称:joomla-cms,代码行数:14,代码来源:AdminManagerPage.php

示例8: testFindElementsShouldGetOneOfFoundElementsText

 public function testFindElementsShouldGetOneOfFoundElementsText()
 {
     $selectBox = $this->_driver->findElement(By::id("sel1"));
     $selectBoxOptions = $selectBox->findElements(By::tagName("option"));
     foreach ($selectBoxOptions as $selectBoxOption) {
         $this->assertTrue($selectBoxOption instanceof WebElement);
         if ($selectBoxOption->getAttribute("value") == "4") {
             $selectBoxOption->click();
         }
     }
     foreach ($selectBoxOptions as $selectBoxOption) {
         if ($selectBoxOption->getAttribute("selected") == "true") {
             $this->assertEquals("Black", $selectBoxOption->getText());
         }
     }
 }
开发者ID:ron-inbar,项目名称:PHP-SeleniumClient,代码行数:16,代码来源:WebElementTest.php


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