Nearsoft\SeleniumClient\By::tagName PHP Method

tagName() public static method

Locate by element's tag name
public static tagName ( String $selectorValue ) : Nearsoft\SeleniumClient\By
$selectorValue String
return Nearsoft\SeleniumClient\By
    public static function tagName($selectorValue)
    {
        return new By("tag name", $selectorValue);
    }

Usage Example

 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());
         }
     }
 }
All Usage Examples Of Nearsoft\SeleniumClient\By::tagName