splinter icon indicating copy to clipboard operation
splinter copied to clipboard

WebDriverElement's 'parent' attribute does not work as expected

Open ghost opened this issue 12 years ago • 2 comments

In the DOM world 'parent' is a good name for parent element. However, splinter uses that name for browser. Could you use the name 'browser' instead?

In [3]: browser = splinter.browser.FirefoxWebDriver()
In [4]: browser.visit('http://google.com')
In [5]: logo = browser.find_by_id('hplogo')
In [6]: logo.parent                                                                                                    
Out[6]: <splinter.driver.webdriver.firefox.WebDriver at 0x1c0a390>       

ghost avatar Mar 11 '14 14:03 ghost

I also find this a bit strange but it appears that the selenium bindings have the same peculiarity. The API reference describes WebElement.parent as:

Internal reference to the WebDriver instance this element was found from.

ryneeverett avatar Oct 30 '15 18:10 ryneeverett

@andrewsmedina Seems like we're following WebDriver's lead here. Changing it would probably cause more confusion than anything else.

javascript-error avatar Jan 07 '20 21:01 javascript-error