Nearsoft\SeleniumClient\By::xPath PHP Method

xPath() public static method

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

Usage Example

 public function testSelectByPartialTextShouldSelect()
 {
     $select = new SelectElement($this->_driver->findElement(By::id("sel1")));
     $select->selectByPartialText("Red");
     $this->assertTrue($select->getElement()->findElement(By::xPath("option[@value = 2]"))->isSelected());
     $select = new SelectElement($this->_driver->findElement(By::id("sel2")));
     $select->selectByPartialText("peppers");
     $this->assertTrue($select->getElement()->findElement(By::xPath("option[@value = 'greenpeppers']"))->isSelected());
 }
All Usage Examples Of Nearsoft\SeleniumClient\By::xPath