Skip to content

Conversation

ombre42
Copy link
Contributor

@ombre42 ombre42 commented Dec 10, 2012

ElementFinder.find should return [] when WebDriver.find* returns None
Sorry I took so long to submit this.
Thank you for your hard work.

@ombre42
Copy link
Contributor Author

ombre42 commented Jan 11, 2013

After monkey patching this code in, I have had a lot less failures while waiting for elements to be present. It lead to uncovering yet another bug in Selenium where webdriver's finds return a dict because IE driver is returning an object instead of a list in the JSON. In Selenium2Library this results in
KeyError: 0 for finds without tag constraints or
AttributeError: 'unicode' object has no attribute 'tag_name' if there are constraints

I have entered a defect against selenium on returning None and an object, as both violate the JsonWireProtocol for WebDriver.

@ombre42
Copy link
Contributor Author

ombre42 commented Jan 11, 2013

I have just put a method to process the result from find_by... methods that handles when the result is None and when not isinstance(result, list) in my monkey patching of S2L at work. Do you want me to abort this pull request and submit a new one that handles find returning both None and dict(not list)?

@emanlove
Copy link
Member

@ombre42 Go ahead and submit the the new one. I'm spending some time going through issues for the 1.2 release now and plan on getting a fair amount done in the next few days.

@ombre42
Copy link
Contributor Author

ombre42 commented Feb 27, 2013

combined fix re-submitted as pull request 172

@ombre42 ombre42 closed this Feb 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants