Skip to content

Update code block references in documentation#2613

Open
srinu2003 wants to merge 1 commit intoSeleniumHQ:trunkfrom
srinu2003:patch-1
Open

Update code block references in documentation#2613
srinu2003 wants to merge 1 commit intoSeleniumHQ:trunkfrom
srinu2003:patch-1

Conversation

@srinu2003
Copy link
Copy Markdown

@srinu2003 srinu2003 commented Apr 1, 2026

Description

Updated gh-codeblock line references for Java examples in the WebDriver elements documentation to ensure they correctly point to the current sections of the source files.

Motivation and Context

Several Java code block references were pointing to outdated line numbers due to recent updates in the example files. This created inconsistencies between the documentation and the actual Java code.

This PR fixes those mismatches by updating the line references to the correct locations.

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.
  • I am sure it works.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 1, 2026

👷 Deploy request for selenium-dev pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 31ec368

@qodo-code-review
Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Update Java code block line references in documentation

📝 Documentation

Grey Divider

Walkthroughs

Description
• Updated Java code block line references in WebDriver elements documentation
• Corrected 9 outdated line number ranges pointing to InformationTest.java
• Ensured documentation accurately reflects current source file structure
Diagram
flowchart LR
  A["Documentation File"] -- "Update line references" --> B["Java Examples"]
  B -- "L20-L24 → L27-L29" --> C["Corrected References"]
  B -- "L27-L29 → L32-L34" --> C
  B -- "L32-L34 → L37-L39" --> C
  B -- "L37-L39 → L42-L44" --> C
  B -- "L42-L44 → L47-L50" --> C
  B -- "L49-L50 → L52-L54" --> C
  B -- "L54-L56 → L58-L60" --> C
  B -- "L60-L64 → L64-L68" --> C
Loading

Grey Divider

File Changes

1. website_and_docs/content/documentation/webdriver/elements/information.en.md 📝 Documentation +8/-8

Corrected Java example line references

• Updated 9 Java code block line references to match current source file structure
• Corrected line ranges for methods: isDisplayed, isEnabled, isSelected, getFocusedElement, getRect,
 getTagName, getText, getAttribute
• All references now point to accurate locations in InformationTest.java

website_and_docs/content/documentation/webdriver/elements/information.en.md


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown
Contributor

qodo-code-review bot commented Apr 1, 2026

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Remediation recommended

1. Translations stale codeblocks 🐞 Bug ≡ Correctness
Description
Only the English information page updates the Java gh-codeblock line ranges; the translated pages
(pt-br/ja/zh-cn) still point at the old line numbers, so they will embed the wrong Java snippet for
sections like “Is Displayed/Enabled/Selected”. This leaves non-English docs inconsistent with the
actual Java example file in this branch.
Code

website_and_docs/content/documentation/webdriver/elements/information.en.md[30]

+{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L27-L29" >}}
Evidence
The English page now points “Is Displayed” at InformationTest.java#L27-L29, which contains the
isDisplayed call, but the translated pages still point that section at #L20-L24 (driver setup) and
shift subsequent sections similarly (e.g., isEnabled points at #L27-L29, which is actually
isDisplayed). The referenced Java file confirms what content exists at these line ranges.

website_and_docs/content/documentation/webdriver/elements/information.en.md[24-31]
website_and_docs/content/documentation/webdriver/elements/information.zh-cn.md[22-57]
website_and_docs/content/documentation/webdriver/elements/information.ja.md[28-65]
website_and_docs/content/documentation/webdriver/elements/information.pt-br.md[29-66]
examples/java/src/test/java/dev/selenium/elements/InformationTest.java[18-33]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The translated “Information” pages still reference outdated `gh-codeblock` line ranges for the Java examples, so they embed the wrong snippet from `InformationTest.java`.

### Issue Context
`information.en.md` was updated to the new correct Java ranges (e.g., `#L27-L29` for `isDisplayed`). The equivalent Java code blocks in `information.zh-cn.md`, `information.ja.md`, and `information.pt-br.md` still use the previous ranges (e.g., `#L20-L24`), which now point at driver setup instead of the method being documented.

Update the translated pages’ Java `gh-codeblock` ranges to match the English page’s current ranges:
- `isDisplayed`: `#L27-L29`
- `isEnabled`: `#L32-L34`
- `isSelected`: `#L37-L39`
- `getTagName`: `#L42-L44`
- `getRect`: `#L47-L50`
- `getCssValue`: `#L52-L54`
- `getText`: `#L58-L60`
- `getAttribute`: `#L64-L68`

### Fix Focus Areas
- website_and_docs/content/documentation/webdriver/elements/information.zh-cn.md[22-270]
- website_and_docs/content/documentation/webdriver/elements/information.ja.md[28-270]
- website_and_docs/content/documentation/webdriver/elements/information.pt-br.md[29-285]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant