Qodo's re-review (after the previous fix commit) flagged that
UserPromptClosedEvent waits for the closed event without ever explicitly
closing the prompt, calling it implicit/behavior-dependent.
Tried making it deterministic by explicitly calling HandleUserPromptAsync
after waiting for UserPromptOpened. That actually broke the test:
OpenQA.Selenium.BiDi.BiDiException: no such alert: No dialog is showing.
Chrome's default unhandledPromptBehavior ("dismiss and notify") already
closes the prompt on its own, faster than an explicit BiDi call can act on
it. This is a known, deliberate constraint in this codebase already:
HandleUserPrompt.cs uses Firefox specifically ("temporary use firefox
because of chrome automatically handle prompts") whenever the example
needs to demonstrate an explicit close.
Reverted the explicit-close attempt and documented the actual mechanism in
a comment instead: Chrome's own auto-dismiss is what raises the event
here, with a pointer to HandleUserPrompt.cs for the explicit-close
pattern. Verified the full 31-test suite passes with this change, and
updated the shifted gh-codeblock line reference in all four locales.
Qodo's other two remaining findings on this PR were addressed in the
previous commit's message: "Partial accessibility mismatch" is a false
positive (dotnet build and all tests pass with this exact partial-class
pattern), and "Two browsers started" is a pre-existing structural choice
from the original PR (#1940), not introduced here.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
User description
Examples for https://www.selenium.dev/documentation/webdriver/bidi/w3c/browsing_context/
TODO:
Types of changes
Checklist
PR Type
Tests, Enhancement
Description
BaseTestclass to include WebSocket URL option in ChromeOptions.Changes walkthrough 📝
1 files
BaseTest.cs
Add WebSocket URL option to ChromeOptionsexamples/dotnet/SeleniumDocs/BaseTest.cs
UseWebSocketUrloption to ChromeOptions.11 files
BrowsingContextTest.BrowsingContextCreatedEvent.cs
Add test for BrowsingContextCreatedEventexamples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.BrowsingContextCreatedEvent.cs
BrowsingContextTest.BrowsingContextDestroyedEvent.cs
Add test for BrowsingContextDestroyedEventexamples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.BrowsingContextDestroyedEvent.cs
BrowsingContextTest.BrowsingContextLoadedEvent.cs
Add test for BrowsingContextLoadedEventexamples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.BrowsingContextLoadedEvent.cs
BrowsingContextTest.CreateBrowsingContext.cs
Add tests for creating browsing contextsexamples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.CreateBrowsingContext.cs
BrowsingContextTest.DomContentLoadedEvent.cs
Add test for DomContentLoadedEventexamples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.DomContentLoadedEvent.cs
BrowsingContextTest.FragmentNavigatedEvent.cs
Add test for FragmentNavigatedEventexamples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.FragmentNavigatedEvent.cs
BrowsingContextTest.GetBrowsingContextTree.cs
Add test for retrieving browsing context treeexamples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.GetBrowsingContextTree.cs
BrowsingContextTest.NavigateToUrl.cs
Add tests for URL navigationexamples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.NavigateToUrl.cs
BrowsingContextTest.NavigationStartedEvent.cs
Add test for NavigationStartedEventexamples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.NavigationStartedEvent.cs
BrowsingContextTest.UserPromptEvent.cs
Add tests for user prompt eventsexamples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.UserPromptEvent.cs
BrowsingContextTest.cs
Create BrowsingContextTest partial classexamples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.cs
1 files
NuGet.config
Add GitHub Packages to NuGet sourcesexamples/dotnet/SeleniumDocs/NuGet.config
1 files
SeleniumDocs.csproj
Update Selenium.WebDriver package versionexamples/dotnet/SeleniumDocs/SeleniumDocs.csproj