Nearsoft\SeleniumClient\By::jsSelector PHP Method

jsSelector() public static method

Locate by JavaScript selector
public static jsSelector ( string $selectorValue, string $selectorDefinition = '$' ) : Nearsoft\SeleniumClient\By
$selectorValue string
$selectorDefinition string
return Nearsoft\SeleniumClient\By
    public static function jsSelector($selectorValue, $selectorDefinition = '$')
    {
        return new By("js selector {$selectorDefinition}", $selectorValue);
    }

Usage Example

 public function testFindElementByJsSelectorShouldGetChildElement()
 {
     $selectBox = $this->_driver->findElement(By::id("sel1"));
     $option = $selectBox->findElement(By::jsSelector('option[selected="selected"]', 'document.querySelector'));
     $this->assertEquals('Orange', $option->getText());
 }
All Usage Examples Of Nearsoft\SeleniumClient\By::jsSelector