Skip to content

Update CSharp code block reference in options.en.md#2612

Open
kimtg wants to merge 3 commits into
SeleniumHQ:trunkfrom
kimtg:patch-2
Open

Update CSharp code block reference in options.en.md#2612
kimtg wants to merge 3 commits into
SeleniumHQ:trunkfrom
kimtg:patch-2

Conversation

@kimtg

@kimtg kimtg commented Mar 30, 2026

Copy link
Copy Markdown

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

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.

@netlify

netlify Bot commented Mar 30, 2026

Copy link
Copy Markdown

Deploy Preview for selenium-dev ready!

Name Link
🔨 Latest commit 8c1372e
🔍 Latest deploy log https://app.netlify.com/projects/selenium-dev/deploys/6a51eec66a3e600008b2e939
😎 Deploy Preview https://deploy-preview-2612--selenium-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@CLAassistant

CLAassistant commented Mar 30, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ diemol
✅ rpallavisharma
❌ kimtg
You have signed the CLA already but the status is still pending? Let us recheck it.

@qodo-code-review

Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Add CSharp code block reference to options documentation

📝 Documentation

Grey Divider

Walkthroughs

Description
• Replace placeholder badge with actual CSharp code reference
• Link to specific code example in dotnet SeleniumDocs repository
• Maintain consistency with other language code block references
Diagram
flowchart LR
  A["Badge placeholder"] -- "replaced with" --> B["gh-codeblock reference"]
  B -- "points to" --> C["OptionsTest.cs lines 59-60"]
Loading

Grey Divider

File Changes

1. website_and_docs/content/documentation/webdriver/drivers/options.en.md 📝 Documentation +1/-1

Replace CSharp badge placeholder with code reference

• Replaced generic badge-code placeholder with specific gh-codeblock reference
• Added path to CSharp example file: /examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L59-60
• Aligns CSharp documentation with Python and Ruby code block references

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


Grey Divider

Qodo Logo

@qodo-code-review

qodo-code-review Bot commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Empty C# code block 🐞 Bug ≡ Correctness
Description
options.en.md now references OptionsTest.cs#L59-60, but OptionsTest.cs ends at line 57, so
gh-codeblock will slice an empty snippet and render a blank code block for the CSharp tab.
Code

website_and_docs/content/documentation/webdriver/drivers/options.en.md[415]

+{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L59-60">}}
Evidence
The page now includes a gh-codeblock pointing at OptionsTest.cs#L59-60, but the referenced file
only contains 57 lines. The shortcode computes an index based on the fragment and uses
after/first to slice lines; when the starting index is beyond the file length, the resulting
slice is empty, producing an empty highlighted block.

website_and_docs/content/documentation/webdriver/drivers/options.en.md[407-420]
examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs[1-57]
website_and_docs/layouts/shortcodes/gh-codeblock.html[44-52]

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 C# `gh-codeblock` reference points to a line range that does not exist in the referenced file, which renders an empty code snippet.

### Issue Context
`gh-codeblock` slices the remote file content based on the `#Lx-y` fragment; if `fromLine` is beyond EOF, the snippet becomes empty.

### Fix Focus Areas
- website_and_docs/content/documentation/webdriver/drivers/options.en.md[414-416]
- examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs[1-57]

### What to change
- Update the `path=` fragment to a valid line range that exists in the target file **and** actually demonstrates `unhandledPromptBehavior` for C#.
- If there is no valid C# example yet, revert this tab back to `{{< badge-code >}}` until a suitable example is added.

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



Remediation recommended

2. Code modal ID collision ✓ Resolved 🐞 Bug ☼ Reliability
Description
gh-codeblock uses only the file path to generate modal IDs, so adding another snippet from the
already-reused OptionsTest.cs path increases duplicate HTML IDs and can cause “View Complete Code”
to open the wrong modal content.
Code

website_and_docs/content/documentation/webdriver/drivers/options.en.md[415]

+{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L59-60">}}
Evidence
options.en.md already embeds multiple gh-codeblock snippets from the same OptionsTest.cs path
(different fragments). The shortcode derives $uniqueId from md5 $path (path only, not fragment),
and uses that value in element IDs; multiple instances on the same page therefore produce duplicate
IDs and event handlers targeting the first matching element.

website_and_docs/content/documentation/webdriver/drivers/options.en.md[114-125]
website_and_docs/content/documentation/webdriver/drivers/options.en.md[155-166]
website_and_docs/content/documentation/webdriver/drivers/options.en.md[195-205]
website_and_docs/content/documentation/webdriver/drivers/options.en.md[407-419]
website_and_docs/layouts/shortcodes/gh-codeblock.html[62-66]
website_and_docs/layouts/shortcodes/gh-codeblock.html[76-90]

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

### Issue description
Multiple `gh-codeblock` invocations referencing the same file path on the same page create duplicate modal element IDs, which can break the “View Complete Code” behavior.

### Issue Context
`gh-codeblock` sets `$uniqueId := md5 $path`, so the ID does not vary by fragment/line range.

### Fix Focus Areas
- website_and_docs/layouts/shortcodes/gh-codeblock.html[62-66]
- website_and_docs/layouts/shortcodes/gh-codeblock.html[76-93]

### What to change
- Derive the modal ID from something truly unique per embed, e.g. hash `$fullPath` (includes fragment) instead of `$path`, or concatenate `$path` + fragment before hashing.
- Ensure all `id=` attributes and JS calls (`showCodeModal`, `closeCodeModal`, `copyCode`) use the updated unique ID consistently.

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


Grey Divider

Qodo Logo

{{% /tab %}}
{{< tab header="CSharp" >}}
{{< badge-code >}}
{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L59-60">}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Action required

1. Empty c# code block 🐞 Bug ✓ Correctness

options.en.md now references OptionsTest.cs#L59-60, but OptionsTest.cs ends at line 57, so
gh-codeblock will slice an empty snippet and render a blank code block for the CSharp tab.
Agent Prompt
### Issue description
The C# `gh-codeblock` reference points to a line range that does not exist in the referenced file, which renders an empty code snippet.

### Issue Context
`gh-codeblock` slices the remote file content based on the `#Lx-y` fragment; if `fromLine` is beyond EOF, the snippet becomes empty.

### Fix Focus Areas
- website_and_docs/content/documentation/webdriver/drivers/options.en.md[414-416]
- examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs[1-57]

### What to change
- Update the `path=` fragment to a valid line range that exists in the target file **and** actually demonstrates `unhandledPromptBehavior` for C#.
- If there is no valid C# example yet, revert this tab back to `{{< badge-code >}}` until a suitable example is added.

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

@rpallavisharma

Copy link
Copy Markdown
Member

@kimtg please see the error generated by qodo.

@qodo-code-review

qodo-code-review Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Wrong C# example embedded 🐞 Bug ≡ Correctness ⭐ New
Description
The unhandledPromptBehavior CSharp tab embeds code from OptionsTest.cs, but that file only contains
PageLoadStrategy tests and does not demonstrate unhandled prompt behavior. This will render an
unrelated C# example for that section and mislead readers.
Code

website_and_docs/content/documentation/webdriver/drivers/options.en.md[415]

+{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L59-60">}}
Evidence
The updated doc embeds a C# snippet from OptionsTest.cs for the unhandledPromptBehavior section,
but the referenced file contains only SetPageLoadStrategy* tests and no unhandled-prompt behavior
example, so it cannot correctly support that documentation section.

website_and_docs/content/documentation/webdriver/drivers/options.en.md[407-416]
examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs[10-56]

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 `unhandledPromptBehavior` section’s C# tab now embeds a snippet from `examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs`, but that file does not contain any example related to unhandled prompt behavior.

## Issue Context
`OptionsTest.cs` currently only contains tests setting `chromeOptions.PageLoadStrategy`.

## Fix
Do one of the following:
1) Point `gh-codeblock` at the correct .NET example file/lines that actually demonstrate unhandled prompt behavior (if it exists), OR
2) Add a correct .NET example (e.g., setting the appropriate option/capability) to an examples file, then update the `gh-codeblock` line-range to that example, OR
3) Revert this C# tab back to `{{< badge-code >}}` until a real example exists.

## Fix Focus Areas
- website_and_docs/content/documentation/webdriver/drivers/options.en.md[414-416]
- examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs[1-56]

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


2. Empty C# code block 🐞 Bug ≡ Correctness
Description
options.en.md now references OptionsTest.cs#L59-60, but OptionsTest.cs ends at line 57, so
gh-codeblock will slice an empty snippet and render a blank code block for the CSharp tab.
Code

website_and_docs/content/documentation/webdriver/drivers/options.en.md[415]

+{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L59-60">}}
Evidence
The page now includes a gh-codeblock pointing at OptionsTest.cs#L59-60, but the referenced file
only contains 57 lines. The shortcode computes an index based on the fragment and uses
after/first to slice lines; when the starting index is beyond the file length, the resulting
slice is empty, producing an empty highlighted block.

website_and_docs/content/documentation/webdriver/drivers/options.en.md[407-420]
examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs[1-57]
website_and_docs/layouts/shortcodes/gh-codeblock.html[44-52]

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 C# `gh-codeblock` reference points to a line range that does not exist in the referenced file, which renders an empty code snippet.

### Issue Context
`gh-codeblock` slices the remote file content based on the `#Lx-y` fragment; if `fromLine` is beyond EOF, the snippet becomes empty.

### Fix Focus Areas
- website_and_docs/content/documentation/webdriver/drivers/options.en.md[414-416]
- examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs[1-57]

### What to change
- Update the `path=` fragment to a valid line range that exists in the target file **and** actually demonstrates `unhandledPromptBehavior` for C#.
- If there is no valid C# example yet, revert this tab back to `{{< badge-code >}}` until a suitable example is added.

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



Remediation recommended

3. Malformed codeblock fragment 🐞 Bug ≡ Correctness
Description
The new gh-codeblock reference uses #L59-60 instead of the documented #Lx-Ly format, so the
generated “View on GitHub” URL does not follow the repo’s documented line-range convention. This
makes the outbound link inconsistent with the project’s own gh-codeblock usage examples and may
prevent expected line-range navigation behavior.
Code

website_and_docs/content/documentation/webdriver/drivers/options.en.md[415]

+{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L59-60">}}
Evidence
options.en.md introduces the fragment #L59-60. The style guide shows the expected gh-codeblock
line-range format as #Lx-Ly, and the gh-codeblock shortcode constructs the GitHub URL directly
from the provided path (including its fragment), so the malformed fragment becomes part of the
rendered link.

website_and_docs/content/documentation/webdriver/drivers/options.en.md[414-416]
website_and_docs/content/documentation/about/style.en.md[148-191]
website_and_docs/layouts/shortcodes/gh-codeblock.html[22-28]
website_and_docs/layouts/shortcodes/gh-codeblock.html[44-49]

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 new `gh-codeblock` path fragment is `#L59-60`, but the project’s style guide documents `gh-codeblock` line ranges using `#L<from>-L<to>` (e.g. `#L25-L26`). Because the shortcode builds the GitHub URL directly from the provided `path`, the nonstandard fragment is propagated to the “View on GitHub” link.

## Issue Context
The shortcode parses fragments by splitting on `-` and stripping `L`, so the snippet slicing might still work, but the outbound GitHub URL will not match the documented format used elsewhere.

## Fix Focus Areas
- website_and_docs/content/documentation/webdriver/drivers/options.en.md[415-415]

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


4. Code modal ID collision ✓ Resolved 🐞 Bug ☼ Reliability
Description
gh-codeblock uses only the file path to generate modal IDs, so adding another snippet from the
already-reused OptionsTest.cs path increases duplicate HTML IDs and can cause “View Complete Code”
to open the wrong modal content.
Code

website_and_docs/content/documentation/webdriver/drivers/options.en.md[415]

+{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L59-60">}}
Evidence
options.en.md already embeds multiple gh-codeblock snippets from the same OptionsTest.cs path
(different fragments). The shortcode derives $uniqueId from md5 $path (path only, not fragment),
and uses that value in element IDs; multiple instances on the same page therefore produce duplicate
IDs and event handlers targeting the first matching element.

website_and_docs/content/documentation/webdriver/drivers/options.en.md[114-125]
website_and_docs/content/documentation/webdriver/drivers/options.en.md[155-166]
website_and_docs/content/documentation/webdriver/drivers/options.en.md[195-205]
website_and_docs/content/documentation/webdriver/drivers/options.en.md[407-419]
website_and_docs/layouts/shortcodes/gh-codeblock.html[62-66]
website_and_docs/layouts/shortcodes/gh-codeblock.html[76-90]

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

### Issue description
Multiple `gh-codeblock` invocations referencing the same file path on the same page create duplicate modal element IDs, which can break the “View Complete Code” behavior.

### Issue Context
`gh-codeblock` sets `$uniqueId := md5 $path`, so the ID does not vary by fragment/line range.

### Fix Focus Areas
- website_and_docs/layouts/shortcodes/gh-codeblock.html[62-66]
- website_and_docs/layouts/shortcodes/gh-codeblock.html[76-93]

### What to change
- Derive the modal ID from something truly unique per embed, e.g. hash `$fullPath` (includes fragment) instead of `$path`, or concatenate `$path` + fragment before hashing.
- Ensure all `id=` attributes and JS calls (`showCodeModal`, `closeCodeModal`, `copyCode`) use the updated unique ID consistently.

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


Grey Divider

Previous review results

Review updated until commit 8c1372e

Results up to commit bb97ce5


🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Remediation recommended
1. Malformed codeblock fragment 🐞 Bug ≡ Correctness
Description
The new gh-codeblock reference uses #L59-60 instead of the documented #Lx-Ly format, so the
generated “View on GitHub” URL does not follow the repo’s documented line-range convention. This
makes the outbound link inconsistent with the project’s own gh-codeblock usage examples and may
prevent expected line-range navigation behavior.
Code

website_and_docs/content/documentation/webdriver/drivers/options.en.md[415]

+{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L59-60">}}
Evidence
options.en.md introduces the fragment #L59-60. The style guide shows the expected gh-codeblock
line-range format as #Lx-Ly, and the gh-codeblock shortcode constructs the GitHub URL directly
from the provided path (including its fragment), so the malformed fragment becomes part of the
rendered link.

website_and_docs/content/documentation/webdriver/drivers/options.en.md[414-416]
website_and_docs/content/documentation/about/style.en.md[148-191]
website_and_docs/layouts/shortcodes/gh-codeblock.html[22-28]
website_and_docs/layouts/shortcodes/gh-codeblock.html[44-49]

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 new `gh-codeblock` path fragment is `#L59-60`, but the project’s style guide documents `gh-codeblock` line ranges using `#L<from>-L<to>` (e.g. `#L25-L26`). Because the shortcode builds the GitHub URL directly from the provided `path`, the nonstandard fragment is propagated to the “View on GitHub” link.

## Issue Context
The shortcode parses fragments by splitting on `-` and stripping `L`, so the snippet slicing might still work, but the outbound GitHub URL will not match the documented format used elsewhere.

## Fix Focus Areas
- website_and_docs/content/documentation/webdriver/drivers/options.en.md[415-415]

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


Qodo Logo

{{% /tab %}}
{{< tab header="CSharp" >}}
{{< badge-code >}}
{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L59-60">}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remediation recommended

1. Malformed codeblock fragment 🐞 Bug ≡ Correctness

The new gh-codeblock reference uses #L59-60 instead of the documented #Lx-Ly format, so the
generated “View on GitHub” URL does not follow the repo’s documented line-range convention. This
makes the outbound link inconsistent with the project’s own gh-codeblock usage examples and may
prevent expected line-range navigation behavior.
Agent Prompt
## Issue description
The new `gh-codeblock` path fragment is `#L59-60`, but the project’s style guide documents `gh-codeblock` line ranges using `#L<from>-L<to>` (e.g. `#L25-L26`). Because the shortcode builds the GitHub URL directly from the provided `path`, the nonstandard fragment is propagated to the “View on GitHub” link.

## Issue Context
The shortcode parses fragments by splitting on `-` and stripping `L`, so the snippet slicing might still work, but the outbound GitHub URL will not match the documented format used elsewhere.

## Fix Focus Areas
- website_and_docs/content/documentation/webdriver/drivers/options.en.md[415-415]

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

@diemol

diemol commented Jul 11, 2026

Copy link
Copy Markdown
Member

Can you please sign the CLA?

{{% /tab %}}
{{< tab header="CSharp" >}}
{{< badge-code >}}
{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L59-60">}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Action required

1. Wrong c# example embedded 🐞 Bug ≡ Correctness

The unhandledPromptBehavior CSharp tab embeds code from OptionsTest.cs, but that file only contains
PageLoadStrategy tests and does not demonstrate unhandled prompt behavior. This will render an
unrelated C# example for that section and mislead readers.
Agent Prompt
## Issue description
The `unhandledPromptBehavior` section’s C# tab now embeds a snippet from `examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs`, but that file does not contain any example related to unhandled prompt behavior.

## Issue Context
`OptionsTest.cs` currently only contains tests setting `chromeOptions.PageLoadStrategy`.

## Fix
Do one of the following:
1) Point `gh-codeblock` at the correct .NET example file/lines that actually demonstrate unhandled prompt behavior (if it exists), OR
2) Add a correct .NET example (e.g., setting the appropriate option/capability) to an examples file, then update the `gh-codeblock` line-range to that example, OR
3) Revert this C# tab back to `{{< badge-code >}}` until a real example exists.

## Fix Focus Areas
- website_and_docs/content/documentation/webdriver/drivers/options.en.md[414-416]
- examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs[1-56]

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

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 8c1372e

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.

4 participants