browser.find_link_by_partial_text() doesn't always work
browser is a splinter.Browser() instance with the firefox driver.
>>> browser.find_link_by_partial_text("admin").text
u'admin DEV'
>>> browser.find_link_by_partial_text("admin DEV")
[]
The html to reproduce this issue
<a class="brand" href="/">
<span>admin</span> <span style="display: inline;" class="env-DEV">DEV</span>
</a>
Please, update the html to include the a tag too.
Sorry it is. I left a bit of it out. Updated the original html
Awkward, Splinter would try to find that using the xpath selector //a[contains(text(), "admin DEV")]. I'll check if another libs with xpath selectors have the same issue.
Can you test that with Chrome and/or zope.testbrowser too, please?
find_link_by_partial_text() will also not find links with line-breaks, e.g.:
<a href="add-employee.html">
<i class="fa fa-fw fa-user"></i>
Add Employee
</a>
If you change the xpath to this one, find_link_by_partial_text() will work (as I expect at least): //a[contains(., "Add Employee")]
The current (wrong) behavior is the same with zope.testbrowser and phantomjs.
This problem still happens. Reopening.
#992 Added tests which confirm this behaviour isn't occurring anymore.