Open kendoctor opened 9 years ago
Does example below work?
$page = $session->getPage();
$title = $page->find('css', 'title')->getText();
Why these two methods have different implementations for finding element? Why not to convert getHtml() returned result to text ?
It's because the WebDriver has native method (text()
) for retrieving text of an element. We're replacing new line symbols with space to allow content comparison from Behat scenario steps. Unfortunately it doesn't have native method for getting node HTML and that's why we're forced to use JavaScript for that.
It does not work.
But is the <title>
tag found? Or it's found but chinese text in it is returned as empty string?
yes. Node is found, but with blank text content, html content is ok.
Then it sounds like bug with Selenium itself, try reporting there.
Thanks. If you know, please give me a reference address.
This seems to be their issue tracker: https://code.google.com/p/selenium/issues/list
//Given this element is a title element $element->getText(); // with blank content $element->getHtml(); // it's ok
Selenium Driver :
Why these two methods have different implementations for finding element? Why not to convert getHtml() returned result to text ?