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

upgraded headers to reflect error messages #1963

Merged
merged 3 commits into from
Sep 26, 2024

Conversation

shbenzer
Copy link
Contributor

@shbenzer shbenzer commented Sep 23, 2024

User description

upgraded headers in error section to reflect actual error messages

Description

edited index.md in all languages

Motivation and Context

increase readability and SEO

Types of changes

  • Change to the site (I have double-checked the Netlify deployment, and my changes look good)
  • Code example added (and I also added the example to all translated languages)
  • Improved translation
  • Added new translation (and I also added a notice to each document missing translation)

Checklist

  • I have read the contributing document.
  • I have used hugo to render the site/docs locally and I am sure it works.

PR Type

documentation


Description

  • Updated exception headers across multiple language documentation files to reflect actual error messages without spaces.
  • Improved consistency and readability of error message headers in English, Japanese, Portuguese, and Chinese documentation.

Changes walkthrough 📝

Relevant files
Documentation
_index.en.md
Standardize exception headers in English documentation.   

website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.en.md

  • Updated exception headers to remove spaces.
  • Changed "Invalid Selector Exception" to "InvalidSelectorException".
  • Changed "No Such Element Exception" to "NoSuchElementException".
  • Changed "Stale Element Reference Exception" to
    "StaleElementReferenceException".
  • Changed "Invalid SessionId Exception" to "InvalidSessionIdException".
  • +4/-4     
    _index.ja.md
    Standardize exception headers in Japanese documentation. 

    website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.ja.md

  • Updated exception headers to remove spaces.
  • Changed "Invalid Selector Exception" to "InvalidSelectorException".
  • Changed "No Such Element Exception" to "NoSuchElementException".
  • Changed "Stale Element Reference Exception" to
    "StaleElementReferenceException".
  • Changed "Invalid SessionId Exception" to "InvalidSessionIdException".
  • +4/-4     
    _index.pt-br.md
    Standardize exception headers in Portuguese documentation.

    website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.pt-br.md

  • Updated exception headers to remove spaces.
  • Changed "Invalid Selector Exception" to "InvalidSelectorException".
  • Changed "No Such Element Exception" to "NoSuchElementException".
  • Changed "Stale Element Reference Exception" to
    "StaleElementReferenceException".
  • Changed "Invalid SessionId Exception" to "InvalidSessionIdException".
  • +4/-4     
    _index.zh-cn.md
    Standardize exception headers in Chinese documentation.   

    website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.zh-cn.md

  • Updated exception headers to remove spaces.
  • Changed "Invalid Selector Exception" to "InvalidSelectorException".
  • Changed "No Such Element Exception" to "NoSuchElementException".
  • Changed "Stale Element Reference Exception" to
    "StaleElementReferenceException".
  • Changed "Invalid SessionId Exception" to "InvalidSessionIdException".
  • +4/-4     

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Copy link

    netlify bot commented Sep 23, 2024

    👷 Deploy request for selenium-dev pending review.

    Visit the deploys page to approve it

    Name Link
    🔨 Latest commit 7564083

    @qodo-merge-pro qodo-merge-pro bot added documentation Improvements or additions to documentation Review effort [1-5]: 2 labels Sep 23, 2024
    Copy link
    Contributor

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Key issues to review

    Consistency
    Ensure that the changes in exception names are consistent across all language versions of the documentation.

    Copy link
    Contributor

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Enhancement
    Add a code example to illustrate a common scenario leading to a NoSuchElementException

    Consider adding a brief code example demonstrating a common scenario that might lead
    to a NoSuchElementException. This can help users better understand and identify the
    issue in their own code.

    website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.en.md [32-34]

     ## NoSuchElementException
     
    -The element can not be found at the exact moment you attempted to locate it.
    +The element can not be found at the exact moment you attempted to locate it. This often occurs when trying to interact with an element before it has loaded on the page. For example:
     
    +```python
    +# This might raise a NoSuchElementException if the element hasn't loaded yet
    +element = driver.find_element(By.ID, "my-element")
    +element.click()
    +```
    +
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: Including a code example is a practical way to help users identify and understand the NoSuchElementException, making the documentation more useful and informative.

    8
    Add an explanation of InvalidSessionIdException and common scenarios where it occurs

    Consider adding a brief explanation of what an InvalidSessionIdException is and
    common scenarios where it might occur. This will provide more context for users
    encountering this error.

    website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.en.md [135-138]

     ## InvalidSessionIdException
    +
    +An InvalidSessionIdException occurs when trying to use a WebDriver session that no longer exists or has become invalid. This can happen if the browser has been closed, the session has timed out, or if you're trying to use a session across different test methods without proper setup.
     
     Sometimes the session you're trying to access is different than what's currently available
     
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: This suggestion adds clarity by explaining the InvalidSessionIdException and typical situations where it might occur, which is beneficial for users troubleshooting this error.

    8
    Add a brief explanation of the InvalidSelectorException to provide more context

    Consider adding a brief explanation of what an InvalidSelectorException is and when
    it typically occurs. This will provide more context for users encountering this
    error.

    website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.en.md [15-17]

     ## InvalidSelectorException
     
    -CSS and XPath Selectors are sometimes difficult to get correct.
    +An InvalidSelectorException occurs when the selector used to find an element is improperly formatted or invalid for the given context. CSS and XPath Selectors are sometimes difficult to get correct.
     
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: The suggestion enhances the documentation by providing additional context about the InvalidSelectorException, which can help users better understand the error and its causes.

    7
    Add examples of scenarios that can cause a StaleElementReferenceException

    Consider adding a brief explanation of common scenarios that can cause a
    StaleElementReferenceException, such as page refreshes or dynamic content changes.
    This will help users understand when they might encounter this error.

    website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.en.md [49-52]

     ## StaleElementReferenceException 
     
     An element goes stale when it was previously located, but can not be currently accessed.
    +This often occurs after page refreshes, navigations, or when dynamic content changes the DOM structure.
     Elements do not get relocated automatically; the driver creates a reference ID for the element and
     
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: The suggestion provides valuable insight into common scenarios that lead to a StaleElementReferenceException, improving user understanding of the error.

    7

    💡 Need additional feedback ? start a PR chat

    Copy link
    Member

    @harsha509 harsha509 left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Makes sense.

    Thank you @shbenzer !

    @harsha509 harsha509 merged commit 744290a into SeleniumHQ:trunk Sep 26, 2024
    3 checks passed
    selenium-ci added a commit that referenced this pull request Sep 26, 2024
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    documentation Improvements or additions to documentation Review effort [1-5]: 2
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants