lettuce_webdriver icon indicating copy to clipboard operation
lettuce_webdriver copied to clipboard

Fix find_button to find the exact match for the button

Open danni opened this issue 10 years ago • 4 comments

Including only normalising the space.

This also means we only make one XPath request.

danni avatar Sep 17 '14 05:09 danni

Was generally thinking of going through and cleaning up the XPath for all of the steps to reduce the number of round trips to Selenium required to use LWD.

danni avatar Sep 17 '14 05:09 danni

I'm not convinced that generating complicated xpath like this is actually a win. It definitely improves performance, but I can barely read it.

npilon avatar Sep 30 '14 23:09 npilon

What would make it more readable?

danni avatar Sep 30 '14 23:09 danni

Perhaps starting with '//button[normalize-space(text())="{value}"]'.format(value=value) and then using += '|stuff' to expand it? I think in this case I'd find that more readable than a generator expression and join.

npilon avatar Oct 01 '14 16:10 npilon