I am able to do this
search = \"View List\"
driver.find_elements_by_xpath(\"//*/text()[normalize-space(.)=\'%s\']/parent::*\" % search)
but I n
The lower-case()
function is only supported from XPath 2.0. For XPath 1.0 you will have to use translate()
.
Example code is given in this stackoverflow answer.
Edit: The selenium python bindings site has a FAQ - Does Selenium 2 supports XPath 2.0 ?:
Ref: http://seleniumhq.org/docs/03_webdriver.html#how-xpath-works-in-webdriver
Selenium delegate XPath queries down to the browser’s own XPath engine, so Selenium support XPath supports whatever the browser supports. In browsers which don’t have native XPath engines (IE 6,7,8), Selenium support XPath 1.0 only.