public function selectorToXpath($selector, $locator)
    {
        if ('xpath' === $selector) {
            if (!is_string($locator)) {
                throw new \InvalidArgumentException('The xpath selector expects to get a string as locator');
            }

            return $locator;
        }

        return $this->getSelector($selector)->translateToXPath($locator);
    }
public function selectorToXpath($selector, $locator)
    {
        if ('xpath' === $selector) {
            if (!is_string($locator)) {
                throw new \InvalidArgumentException('The xpath selector expects to get a string as locator');
            }

            return $locator;
        }

        return $this->getSelector($selector)->translateToXPath($locator);
    }
public function selectorToXpath ( $ selector , $ locator ) { if ( 'xpath' === $ selector ) { if ( ! is_string ( $ locator ) ) { throw new \ InvalidArgumentException ( 'The xpath selector expects to get a string as locator' ) ; } return $ locator ; } return $ this -> getSelector ( $ selector ) -> translateToXPath ( $ locator ) ; }
Translates selector with specified name to XPath.

@param string       $selector selector engine name (registered)
@param string|array $locator  selector locator (an array or a string depending of the selector being used)

@return string
Translates selector with specified name to XPath .