Update CSharp code block reference in options.en.md#2612
Conversation
✅ Deploy Preview for selenium-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
|
Review Summary by QodoAdd CSharp code block reference to options documentation
WalkthroughsDescription• 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 Diagramflowchart LR
A["Badge placeholder"] -- "replaced with" --> B["gh-codeblock reference"]
B -- "points to" --> C["OptionsTest.cs lines 59-60"]
File Changes1. website_and_docs/content/documentation/webdriver/drivers/options.en.md
|
Code Review by Qodo
1. Empty C# code block
|
| {{% /tab %}} | ||
| {{< tab header="CSharp" >}} | ||
| {{< badge-code >}} | ||
| {{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L59-60">}} |
There was a problem hiding this comment.
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
|
@kimtg please see the error generated by qodo. |
Code Review by Qodo
1. Wrong C# example embedded
|
| {{% /tab %}} | ||
| {{< tab header="CSharp" >}} | ||
| {{< badge-code >}} | ||
| {{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L59-60">}} |
There was a problem hiding this comment.
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
|
Can you please sign the CLA? |
| {{% /tab %}} | ||
| {{< tab header="CSharp" >}} | ||
| {{< badge-code >}} | ||
| {{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L59-60">}} |
There was a problem hiding this comment.
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
|
Code review by qodo was updated up to the latest commit 8c1372e |
|
Superseeded by #2724 |
* Add C# example for unhandledPromptBehavior option Adds the missing SetUnhandledPromptBehavior test to OptionsTest.cs and wires the CSharp tab in the docs to it, replacing the placeholder badge. Based on #2611 and #2612 by kimtg. Co-authored-by: KIM Taegyoon <steloflute@gmail.com> Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix: avoid Windows file-lock races in EdgeTest log tests On Windows, msedgedriver can still hold its log file open for a moment after driver.Quit(), so reading the log right after Quit() intermittently threw IOException in LogsToFile, LogsLevel, ConfigureDriverLogs, and DisableBuildCheck. Mirrors the Python and Ruby examples, which read the log while the service is still running instead of after quitting (see 4decac3 for the equivalent Python fix). Also guards the log file deletion in Cleanup() against the same race, tolerating IOException like Python's contextlib.suppress(OSError) and Ruby's FileUtils.rm_f. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix: retry reading Edge log file to survive Windows lock window CI showed the log file is locked for the entire life of the Edge driver service on Windows, not just briefly after Quit() -- moving the read before Quit() (previous commit) failed immediately since the driver process was still running. Reading after Quit() is correct, but the OS still needs a moment to release the handle once the process exits, so wrap the read in a short bounded retry instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix: null-safe driver.Quit() in EdgeTest cleanup If driver creation throws before the field is assigned, Cleanup()'s unconditional driver.Quit() throws NullReferenceException and masks the real test failure. ChromeTest.cs already uses this driver?.Quit() pattern in its own cleanup; apply it here too. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix: widen retry budget for Edge log file read on Windows The previous 2s retry budget (10 x 200ms) wasn't enough -- CI still failed with the same IOException after exhausting all attempts. EdgeDriverService.LogPath is fed by DriverService's async OutputDataReceived event handler (per the Selenium.WebDriver XML docs), so the log FileStream can stay open for several seconds after Quit() returns while the last buffered output drains. Widen the budget to ~9.5s (20 x 500ms) to reliably outlast that tail. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix: narrow EdgeTest log retry to sharing/lock violations only ReadLogLines was retrying on any IOException, so a genuine failure (missing file, bad path, permissions) would silently eat up to ~10s of sleeping before surfacing, slowing down and obscuring real failures. Restrict the retry to the specific Win32 sharing/lock violation HRESULTs the Windows file-lock race actually produces; everything else propagates immediately. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * try: replace log-read retry with explicit service.Dispose() Drop the retry loop and try forcing a real synchronous teardown instead: EdgeDriverService.LogPath is fed by DriverService's async OutputDataReceived handler, so driver.Quit() alone may return before that stream is fully flushed and closed. Holding the service reference and calling service.Dispose() explicitly should block until the log file is actually released, letting us read it with a plain File.ReadAllLines and no polling. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * revert: bring back narrowed retry, keep explicit service.Dispose() The explicit-Dispose-only approach didn't work: CI showed the same IOException immediately after driver.Quit() + service.Dispose(), so DriverService's async OutputDataReceived teardown isn't fully synchronous even through an explicit Dispose() call. Restore the retry (narrowed to actual sharing/lock-violation HRESULTs, ~9.5s budget), and keep the Dispose() call alongside it since it's still correct resource cleanup and may shrink the typical wait. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * simplify: drop HResult filtering and explanatory comments in EdgeTest This is a doc code example, not production code -- the narrowed sharing/lock-violation HResult check added unnecessary verbosity, and comments like "Close the Service log file before reading" get confusing once the file is translated. Keep the retry and service.Dispose(), drop the rest. --------- Co-authored-by: KIM Taegyoon <steloflute@gmail.com> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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
Checklist