You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 example code to windows and modified text
Motivation and Context
Example code was missing, and modified order and some text.
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)
Possible Bug: The test method windowsExampleCode in WindowsTest.java does not handle exceptions that might be thrown during WebDriver operations. It's recommended to add try-catch blocks to handle potential exceptions such as NoSuchElementException or TimeoutException to make the test more robust.
Resource Management: The WebDriver instance is being created and destroyed within the windowsExampleCode method. Consider using a setup and teardown approach for WebDriver to improve test structure and avoid redundancy.
Add a note about the importance of switching back to the original window after closing a new one
Add a note or warning about the importance of switching back to the original window after closing a new window or tab to avoid potential issues with WebDriver.
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/WindowsTest.java#L31-L34" >}}
+// Note: Always switch back to the original window after closing the new one to avoid issues.
Apply this suggestion
Suggestion importance[1-10]: 8
Why: This suggestion is highly relevant as it addresses a common issue that can lead to runtime errors if overlooked. Adding a note ensures users are aware of the necessary steps to avoid No Such Window Exception, which is crucial for robust WebDriver usage.
8
Remove the unnecessary text=true attribute from the Java tab header for consistency
Ensure consistency in the tab headers by removing the text=true attribute from the Java tab, as it is not used in other tabs and may cause inconsistency in rendering.
Why: The suggestion correctly identifies an inconsistency in the use of text=true attribute in the Java tab, which is not present in other language tabs. This change would improve consistency in the document's formatting.
6
Properly close the {{< gh-codeblock >}} tag
Ensure that the {{< gh-codeblock >}} tag is properly closed to avoid rendering issues.
Why: Ensuring proper closure of tags is important for correct rendering, but the original PR code already closes the tag correctly, making this suggestion unnecessary.
5
Enhancement
Add a comment before the gh-codeblock to explain the code snippet
Add a brief description or comment before the gh-codeblock to explain what the code snippet does, similar to how it was done in the old code. This will help users understand the context of the example.
+// Get the current window handle
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/WindowsTest.java#L16-L20" >}}
Apply this suggestion
Suggestion importance[1-10]: 7
Why: Adding a comment before the gh-codeblock would provide context for the code snippet, similar to the previous format, enhancing the understanding for readers. This is a useful improvement for documentation clarity.
7
Add context for the Java code block
Add a brief explanation or comment about what the Java code block does to provide context for users.
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/WindowsTest.java#L16-L20" >}}
+<!-- This code block demonstrates how to get the current window handle in Java -->
Apply this suggestion
Suggestion importance[1-10]: 7
Why: Adding explanatory comments provides valuable context to the code block, enhancing understanding for readers. This is a useful improvement for documentation clarity.
7
Maintainability
Adjust indentation for consistent formatting
Ensure the indentation of the {{< gh-codeblock >}} tag is consistent with the other tabs to maintain proper formatting.
Why: Proper alignment of code examples within tabs is important for readability, but the suggestion lacks specific details on what alignment issue exists and how to resolve it. It is a valid point but needs more precision.
* added example code for windows and switched text order. modified some text also
* fixed tab pane hugo error
---------
Co-authored-by: Sri Harsha <[email protected]> 8ea6e02
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 example code to windows and modified text
Motivation and Context
Example code was missing, and modified order and some text.
Types of changes
Checklist
PR Type
Enhancement, Documentation
Description
WindowsTest.java
.Changes walkthrough 📝
WindowsTest.java
Add example code for handling multiple windows and tabs in Java
examples/java/src/test/java/dev/selenium/interactions/WindowsTest.java
windowsExampleCode
.windows.en.md
Update and reorganize Java examples and explanations for window
handling
website_and_docs/content/documentation/webdriver/interactions/windows.en.md
windows.ja.md
Update and reorganize Java examples and explanations for window
handling (Japanese)
website_and_docs/content/documentation/webdriver/interactions/windows.ja.md
windows.pt-br.md
Update and reorganize Java examples and explanations for window
handling (Portuguese)
website_and_docs/content/documentation/webdriver/interactions/windows.pt-br.md
windows.zh-cn.md
Update and reorganize Java examples and explanations for window
handling (Chinese)
website_and_docs/content/documentation/webdriver/interactions/windows.zh-cn.md