Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incomplete documentation #4458

Closed
ghost opened this issue Aug 15, 2017 · 8 comments
Closed

Incomplete documentation #4458

ghost opened this issue Aug 15, 2017 · 8 comments

Comments

@ghost
Copy link

ghost commented Aug 15, 2017

Meta -

OS:

Selenium Version: 3.5.3

Browser:

Browser Version:

Steps to reproduce -

Can I RESPECTFULLY say that I find the Selenium official Python documentation incomplete?

For example, the documentation for selenium.webdriver.remote.webelement fails to point out that find_elements* method always return a list (eventually empty), while find_element* return the element directly or raises a selenium.common.exceptions.NoSuchElementException

The switch_to documentation of selenium.webdriver.remote.webdriver.WebDriver is non-existent (literally)
There is a documentation for switch_to_active_element() and the like which says that the methods are deprecated and you should use driver.switch_to.active_element instead. But what does the switch_to methods do at all? What does it mean to switch to the default element? Or to an alert? Or to a default content?

The example of selenium.webdriver.remote.webelement.WebElement 's get_property() function is wrong. It says

Check if the "active" CSS class is applied to an element.

text_length = target_element.get_property("text_length")

At least the comment is wrong, which seems to have been copy-pasted from the get_attribute(name) function

Check if the "active" CSS class is applied to an element.

is_active = "active" in target_element.get_attribute("class")

Maybe it's just me, or maybe I have found the wrong link from the documentation (the link is on pypi page of selenium). Selenium is a great piece of software, but I think it would be event better if the documentation was better

@luke-hill
Copy link
Contributor

There is an active effort to rebuild the docs from scratch on a diff repo here. Feel free to contribute I'm sure the devs would welcome your suggestions

The website as it stands is here: https://seleniumhq.github.io/docs/

@lmtierney
Copy link
Member

Pull requests are always welcome to fix docstrings in the python bindings.

@ghost
Copy link
Author

ghost commented Aug 17, 2017

@luke-hill thanks for the link.
Your link does not include API documentation, right?
Is your website related to this or there are actually two efforts to rebuild the docs?

@manoj9788
Copy link
Member

manoj9788 commented Aug 17, 2017

@raffam the link that Luke provided is the project to rewrite the docs - your patches should go into the python doc-strings as @lmtierney mentioned. Browse the source

@ghost
Copy link
Author

ghost commented Sep 6, 2017

Another thing to document would be the logger. See this StackOverflow discussion

@manoj9788
Copy link
Member

@raffam Feel free to send in a PR

@santiycr
Copy link
Contributor

santiycr commented Nov 9, 2017

PR sent: #5042

@mmerrell
Copy link
Contributor

mmerrell commented Nov 9, 2017 via email

lmtierney pushed a commit that referenced this issue Dec 7, 2017
* improved docstrings for find_element{,s} methods

* Adding docs for switch_to method

* removing wrong copy&pasted comment
@lock lock bot locked and limited conversation to collaborators Aug 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants