public static function jsSelector($selectorValue, $selectorDefinition = '$') { return new By("js selector {$selectorDefinition}", $selectorValue); }
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()); }