/** * Creates element. * * @param array $selector Selector. * * @return AbstractTypifiedElement */ protected function createElement(array $selector) { $selenium_selector = new SeleniumSelector(); $xpath = $selenium_selector->translateToXPath($selector); $web_element = new WebElement(new NodeElement($xpath, $this->session), $this->pageFactory); return new $this->elementClass($web_element, $this->pageFactory); }
/** * Testing incorrect locators. * * @expectedException \QATools\QATools\PageObject\Exception\ElementException * @expectedExceptionCode \QATools\QATools\PageObject\Exception\ElementException::TYPE_INCORRECT_SELECTOR * @expectedExceptionMessage Incorrect Selenium selector format * @dataProvider incorrectDataProvider */ public function testIncorrect($locator) { $this->selector->translateToXPath($locator); }