Skip to content

Local driver examples added (Creating Sessions) #2004

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

Merged

Conversation

harshitBhardwaj97
Copy link
Contributor

@harshitBhardwaj97 harshitBhardwaj97 commented Oct 17, 2024

User description

Thanks for contributing to the Selenium site and documentation!
A PR well described will help maintainers to review and merge it quickly

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, and help reviewers by making them as simple and short as possible.

Description

Added the local driver examples under Creating Sessions section of drivers page for Java, CSharp and JS. Have verified the fixes locally. Here's the video for reference -

addLocalDriverExamples_Selenium.mp4

Motivation and Context

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

  • Added local driver examples for Java, CSharp, and JavaScript in the documentation.
  • Improved formatting for better readability across multiple language versions.
  • Updated code snippets to use gh-codeblock for consistency.

Changes walkthrough 📝

Relevant files
Documentation
_index.en.md
Add local driver examples and improve formatting                 

website_and_docs/content/documentation/webdriver/drivers/_index.en.md

  • Added examples for local driver creation in Java, CSharp, and
    JavaScript.
  • Updated formatting for better readability.
  • +8/-7     
    _index.ja.md
    Add local driver examples and improve formatting                 

    website_and_docs/content/documentation/webdriver/drivers/_index.ja.md

  • Added examples for local driver creation in Java, CSharp, and
    JavaScript.
  • Improved formatting for better readability.
  • +5/-6     
    _index.pt-br.md
    Add local driver examples and improve formatting                 

    website_and_docs/content/documentation/webdriver/drivers/_index.pt-br.md

  • Added examples for local driver creation in Java, CSharp, and
    JavaScript.
  • Improved formatting for better readability.
  • +8/-7     
    _index.zh-cn.md
    Add local driver examples and improve formatting                 

    website_and_docs/content/documentation/webdriver/drivers/_index.zh-cn.md

  • Added examples for local driver creation in Java, CSharp, and
    JavaScript.
  • Improved formatting for better readability.
  • +4/-5     

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

    Added the local driver examples under Creating Sessions
    section of drivers page for Java, CSharp and JS. Have verified
    the fixes locally.
    Copy link

    netlify bot commented Oct 17, 2024

    👷 Deploy request for selenium-dev pending review.

    Visit the deploys page to approve it

    Name Link
    🔨 Latest commit 01761ed

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

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Consistency
    Ensure that the formatting and structure of the added code examples are consistent across all language tabs.

    Documentation Clarity
    Verify that the added explanation about the difference between 'quit' and 'close' methods is clear and accurate.

    Copy link
    Contributor

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Enhancement
    Clarify the difference between quit() and close() methods to explain the recommendation

    Consider adding a brief explanation of the difference between quit() and close()
    methods to clarify why quit() is recommended for ending the session.

    website_and_docs/content/documentation/webdriver/drivers/_index.en.md [60-61]

     Important note: the `quit` method is different from the `close` method,
    -and it is recommended to always use `quit` to end the session
    +and it is recommended to always use `quit` to end the session.
    +The `quit()` method closes all associated windows and ends the WebDriver session,
    +while `close()` only closes the current window, potentially leaving the session active.
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: The suggestion adds valuable information by explaining the functional differences between quit() and close(), which clarifies why quit() is recommended. This enhances the documentation by providing users with a better understanding of session management in Selenium.

    8
    Add a brief example of using Options to provide more context for session configuration

    Consider adding a brief explanation or example of how to use the Options class to
    customize the session. This will provide more context for users who are new to
    Selenium or need guidance on configuring their sessions.

    website_and_docs/content/documentation/webdriver/drivers/_index.en.md [17-18]

     * [Options]({{< ref "options.md" >}}) to describe the kind of session you want; default values are used for local, but
    -  this is required for remote
    +  this is required for remote. For example:
    +  ```java
    +  ChromeOptions options = new ChromeOptions();
    +  options.addArguments("--start-maximized");
    +  WebDriver driver = new ChromeDriver(options);
    +  ```
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: The suggestion provides a practical example of using the Options class, which can help users understand how to customize sessions. This enhancement is relevant and useful for users new to Selenium, improving the documentation's clarity and usability.

    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.

    Thank you @harshitBhardwaj97 !

    @harsha509 harsha509 merged commit 8992e9c into SeleniumHQ:trunk Oct 17, 2024
    3 checks passed
    selenium-ci added a commit that referenced this pull request Oct 17, 2024
    Added the local driver examples under Creating Sessions
    section of drivers page for Java, CSharp and JS. Have verified
    the fixes locally.
    
    Co-authored-by: Sri Harsha <12621691+harsha509@users.noreply.github.com> 8992e9c
    @harshitBhardwaj97
    Copy link
    Contributor Author

    Welcome @harsha509

    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