Skip to content

[dotnet] [test] Moves Urls knowledge to testing web server - #17724

Merged
nvborisenko merged 2 commits into
SeleniumHQ:trunkfrom
nvborisenko:dotnet-test-url-builder
Jun 28, 2026
Merged

[dotnet] [test] Moves Urls knowledge to testing web server#17724
nvborisenko merged 2 commits into
SeleniumHQ:trunkfrom
nvborisenko:dotnet-test-url-builder

Conversation

@nvborisenko

Copy link
Copy Markdown
Member

UrlBuilder now is part of test WebServer, because only this have knowledge of predefined urls.

🔗 Related Issues

Contributes to #15536

💥 What does this PR do?

Massive infra test update.

🔧 Implementation Notes

Step to isolated and parallelizable tests.

🤖 AI assistance

  • No substantial AI assistance used
  • AI assisted (complete below)
    • Tool(s):
    • What was generated:
    • I reviewed all AI output and can explain the change

💡 Additional Considerations

In Java tests it is still UrlBuilder, but it is Java, should not be show stopper.

🔄 Types of changes

  • Cleanup (formatting, renaming)

@selenium-ci selenium-ci added C-dotnet .NET Bindings B-support Issue or PR related to support classes labels Jun 28, 2026
@selenium-ci

Copy link
Copy Markdown
Member

Thank you, @nvborisenko for this code suggestion.

The support packages contain example code that many users find helpful, but they do not necessarily represent
the best practices for using Selenium, and the Selenium team is not currently merging changes to them.

After reviewing the change, unless it is a critical fix or a feature that is needed for Selenium
to work, we will likely close the PR.

We actively encourage people to add the wrapper and helper code that makes sense for them to their own frameworks.
If you have any questions, please contact us

@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Move test UrlBuilder ownership to AppServer and update .NET tests
🧪 Tests ✨ Enhancement 🕐 40+ Minutes

Grey Divider

Description

• Move predefined test URL knowledge from EnvironmentManager into the test WebServer.
• Expose AppServer.Urls and update tests to use Urls.* instead of fixture strings.
• Centralize URL construction to improve test isolation and parallel execution readiness.
Diagram

graph TD
  T[Tests] --> FX["Test fixtures"] --> EM["EnvironmentManager"] --> WS["AppServer"] --> UB["UrlBuilder"] --> P["Test pages"]
  UB -->|"POST createPage"| WS
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Keep UrlBuilder on EnvironmentManager but delegate to WebServer.Urls
  • ➕ Less churn in call sites (tests keep using EnvironmentManager.Instance.UrlBuilder)
  • ➕ EnvironmentManager stays the single entry point for test infra
  • ➖ Still couples URL knowledge to the environment layer rather than the server instance
  • ➖ Less explicit support for multiple concurrent servers (parallel execution)
2. Introduce an IUrlProvider interface implemented by AppServer
  • ➕ Decouples tests from a concrete UrlBuilder type
  • ➕ Enables swapping providers (local vs remote server) without rewriting tests
  • ➖ Additional abstraction/boilerplate for a straightforward refactor
  • ➖ More moving parts for limited immediate benefit
3. Compute well-known page URLs from server route metadata at runtime
  • ➕ Reduces hardcoded page-name constants
  • ➕ Can validate content presence when the server starts
  • ➖ Higher complexity and runtime dependency on route discovery
  • ➖ Harder to keep tests readable and stable across environments

Recommendation: The PR’s approach (AppServer owns and exposes UrlBuilder) best matches the goal of isolating tests and supporting parallel execution: URL knowledge becomes a property of a specific server instance. The interface-based approach is only worth it if multiple interchangeable URL providers are expected soon.

Files changed (100) +1294 / -1178

Refactor (5) +197 / -82
AppServer.csAdd AppServer.Urls and initialize it during StartAsync +8/-1

Add AppServer.Urls and initialize it during StartAsync

• Introduces an Urls property on the test web server and constructs UrlBuilder from the resolved HTTP/HTTPS base URLs after startup.

dotnet/test/testing.webserver/AppServer.cs

InlinePage.csMove InlinePage into WebServer namespace and enable nullable fields +4/-3

Move InlinePage into WebServer namespace and enable nullable fields

• Relocates InlinePage to OpenQA.Selenium.Testing.WebServer and marks onLoad/onBeforeUnload as nullable to reflect optional usage.

dotnet/test/testing.webserver/InlinePage.cs

UrlBuilder.csAdd UrlBuilder to testing.webserver with well-known page properties +182/-0

Add UrlBuilder to testing.webserver with well-known page properties

• Adds a UrlBuilder under OpenQA.Selenium.Testing.WebServer with helpers for common pages, alternate host addressing, and CreateInlinePage posting to the server.

dotnet/test/testing.webserver/UrlBuilder.cs

DriverTestFixture.csRemove predefined URL fields and expose Urls builder +2/-73

Remove predefined URL fields and expose Urls builder

• Drops dozens of fixture-level URL string fields and replaces them with a single protected Urls accessor sourced from EnvironmentManager.Instance.WebServer.Urls.

dotnet/test/webdriver/DriverTestFixture.cs

EnvironmentManager.csRemove EnvironmentManager.UrlBuilder and use WebServer.Urls +1/-5

Remove EnvironmentManager.UrlBuilder and use WebServer.Urls

• Stops creating/storing a UrlBuilder on EnvironmentManager; AppServer now owns UrlBuilder via AppServer.Urls after StartAsync().

dotnet/test/webdriver/Infrastructure/Environment/EnvironmentManager.cs

Tests (94) +1096 / -1096
RemoteSessionCreationTests.csUse WebServer Urls for remote session navigation +3/-3

Use WebServer Urls for remote session navigation

• Replaces navigation to legacy fixture URL strings with Urls.XhtmlTestPage from the test WebServer.

dotnet/test/remote/RemoteSessionCreationTests.cs

RemoteSessionEventTests.csUse Urls.SimpleTestPage in remote session event tests +2/-2

Use Urls.SimpleTestPage in remote session event tests

• Updates RemoteWebDriver navigation to use the shared UrlBuilder exposed by EnvironmentManager.Instance.WebServer.Urls.

dotnet/test/remote/RemoteSessionEventTests.cs

RemoteWebDriverSpecificTests.csUse Urls.* in remote-specific WebDriver tests +2/-2

Use Urls.* in remote-specific WebDriver tests

• Migrates test navigation targets (JavaScript/upload) from fixture strings to Urls.JavascriptPage and Urls.UploadPage.

dotnet/test/remote/RemoteWebDriverSpecificTests.cs

EventFiringWebDriverElementTests.csNavigate via Urls.FormsPage in event-firing element tests +1/-1

Navigate via Urls.FormsPage in event-firing element tests

• Replaces setup navigation from formsPage fixture field to Urls.FormsPage.

dotnet/test/support/Events/EventFiringWebDriverElementTests.cs

PopupWindowFinderTests.csNavigate via Urls.XhtmlTestPage in popup window tests +4/-4

Navigate via Urls.XhtmlTestPage in popup window tests

• Updates all navigations to use Urls.XhtmlTestPage instead of the legacy fixture xhtmlTestPage string.

dotnet/test/support/UI/PopupWindowFinderTests.cs

SelectBrowserTests.csUse Urls.FormsPage in SelectBrowser tests +1/-1

Use Urls.FormsPage in SelectBrowser tests

• Updates test setup navigation to use Urls.FormsPage.

dotnet/test/support/UI/SelectBrowserTests.cs

AlertsTests.csUse Urls.CreateInlinePage for generated alert pages +16/-16

Use Urls.CreateInlinePage for generated alert pages

• Replaces EnvironmentManager.Instance.UrlBuilder inline page creation with Urls.CreateInlinePage for alert-related tests.

dotnet/test/webdriver/AlertsTests.cs

BiDiFixture.csSwitch BiDi fixture URL access to WebServer Urls +1/-1

Switch BiDi fixture URL access to WebServer Urls

• Replaces EnvironmentManager.Instance.UrlBuilder with EnvironmentManager.Instance.WebServer.Urls and renames helper to Urls.

dotnet/test/webdriver/BiDi/BiDiFixture.cs

BrowsingContextEventsTests.csUse WebServer Urls in BiDi browsing context events tests +2/-2

Use WebServer Urls in BiDi browsing context events tests

• Updates navigation/URL creation to use Urls from the WebServer instead of the removed EnvironmentManager UrlBuilder.

dotnet/test/webdriver/BiDi/BrowsingContext/BrowsingContextEventsTests.cs

BrowsingContextTests.csUse Urls.* and Urls.WhereIs in BiDi browsing context tests +11/-11

Use Urls.* and Urls.WhereIs in BiDi browsing context tests

• Replaces UrlBuilder usage with Urls, preferring strongly-typed page properties (e.g., AlertsPage/IframesPage/FormsPage) where available.

dotnet/test/webdriver/BiDi/BrowsingContext/BrowsingContextTests.cs

CombinedInputActionsTests.csUse WebServer Urls in BiDi combined input actions tests +1/-1

Use WebServer Urls in BiDi combined input actions tests

• Migrates test page navigation to use Urls rather than EnvironmentManager-owned URL helpers.

dotnet/test/webdriver/BiDi/Input/CombinedInputActionsTests.cs

DefaultKeyboardTests.csUse WebServer Urls in BiDi default keyboard tests +5/-5

Use WebServer Urls in BiDi default keyboard tests

• Updates navigation targets to be built via Urls from the test WebServer.

dotnet/test/webdriver/BiDi/Input/DefaultKeyboardTests.cs

DefaultMouseTests.csUse WebServer Urls in BiDi default mouse tests +1/-1

Use WebServer Urls in BiDi default mouse tests

• Replaces UrlBuilder references with Urls for navigation.

dotnet/test/webdriver/BiDi/Input/DefaultMouseTests.cs

InputEventsTests.csUse WebServer Urls in BiDi input event tests +1/-1

Use WebServer Urls in BiDi input event tests

• Updates navigation/URL building to use Urls.

dotnet/test/webdriver/BiDi/Input/InputEventsTests.cs

SetFilesTests.csUse WebServer Urls in BiDi set-files tests +1/-1

Use WebServer Urls in BiDi set-files tests

• Replaces legacy UrlBuilder usage with Urls for navigation targets.

dotnet/test/webdriver/BiDi/Input/SetFilesTests.cs

LogTests.csUse WebServer Urls in BiDi log tests +3/-3

Use WebServer Urls in BiDi log tests

• Updates navigation targets to use Urls from the test WebServer.

dotnet/test/webdriver/BiDi/Log/LogTests.cs

NetworkEventsTests.csUse WebServer Urls in BiDi network events tests +5/-5

Use WebServer Urls in BiDi network events tests

• Replaces UrlBuilder calls with Urls for page navigation/URL construction.

dotnet/test/webdriver/BiDi/Network/NetworkEventsTests.cs

NetworkTests.csUse WebServer Urls in BiDi network tests +10/-10

Use WebServer Urls in BiDi network tests

• Updates URL construction to use Urls rather than the removed EnvironmentManager.UrlBuilder.

dotnet/test/webdriver/BiDi/Network/NetworkTests.cs

PermissionsTests.csUse WebServer Urls in BiDi permissions tests +1/-1

Use WebServer Urls in BiDi permissions tests

• Migrates navigation targets to Urls.

dotnet/test/webdriver/BiDi/Permissions/PermissionsTests.cs

CallFunctionLocalValueTests.csUse WebServer Urls in BiDi script local value tests +1/-1

Use WebServer Urls in BiDi script local value tests

• Updates navigation targets to use Urls.

dotnet/test/webdriver/BiDi/Script/CallFunctionLocalValueTests.cs

CallFunctionParameterTests.csUse WebServer Urls in BiDi script parameter tests +2/-2

Use WebServer Urls in BiDi script parameter tests

• Replaces UrlBuilder usage with Urls for navigation.

dotnet/test/webdriver/BiDi/Script/CallFunctionParameterTests.cs

SessionTests.csUse WebServer Urls in BiDi session tests +1/-1

Use WebServer Urls in BiDi session tests

• Updates navigation/URL building to use Urls.

dotnet/test/webdriver/BiDi/Session/SessionTests.cs

SpeculationTests.csUse WebServer Urls in BiDi speculation tests +2/-2

Use WebServer Urls in BiDi speculation tests

• Replaces UrlBuilder usage with Urls for navigation.

dotnet/test/webdriver/BiDi/Speculation/SpeculationTests.cs

StorageTests.csUse WebServer Urls in BiDi storage tests +12/-12

Use WebServer Urls in BiDi storage tests

• Updates multiple navigation targets to use Urls from the WebServer.

dotnet/test/webdriver/BiDi/Storage/StorageTests.cs

ChildrenFindingTests.csUse Urls.* page properties in children-finding tests +35/-35

Use Urls.* page properties in children-finding tests

• Replaces navigation via fixture URL strings (e.g., nestedPage/simpleTestPage) with Urls.NestedPage and Urls.SimpleTestPage.

dotnet/test/webdriver/ChildrenFindingTests.cs

ClearTests.csUse Urls.ReadOnlyPage in clear tests +8/-8

Use Urls.ReadOnlyPage in clear tests

• Replaces readOnlyPage fixture field with Urls.ReadOnlyPage for navigation.

dotnet/test/webdriver/ClearTests.cs

ClickScrollingTests.csUse Urls.* in click scrolling tests +18/-18

Use Urls.* in click scrolling tests

• Migrates navigation targets from legacy fixture URL strings to Urls page properties.

dotnet/test/webdriver/ClickScrollingTests.cs

ClickTests.csUse Urls.* in click tests +20/-20

Use Urls.* in click tests

• Replaces legacy fixture URL strings with Urls.* page properties for navigation.

dotnet/test/webdriver/ClickTests.cs

ContentEditableTests.csUse Urls.* in content editable tests +7/-7

Use Urls.* in content editable tests

• Updates page navigation to use Urls from the test WebServer.

dotnet/test/webdriver/ContentEditableTests.cs

CookieImplementationTests.csUse Urls.* in cookie implementation tests +42/-42

Use Urls.* in cookie implementation tests

• Replaces legacy fixture URL strings/UrlBuilder access with Urls.* for navigation and URL building.

dotnet/test/webdriver/CookieImplementationTests.cs

CorrectEventFiringTests.csUse Urls.* in event firing behavior tests +35/-35

Use Urls.* in event firing behavior tests

• Updates navigation targets to use Urls from AppServer.

dotnet/test/webdriver/CorrectEventFiringTests.cs

CssValueTests.csUse Urls.* in CSS value tests +3/-3

Use Urls.* in CSS value tests

• Replaces legacy fixture URL strings with Urls.* page properties.

dotnet/test/webdriver/CssValueTests.cs

DevToolsConsoleTests.csUse Urls.* in DevTools console tests +1/-1

Use Urls.* in DevTools console tests

• Updates navigation targets to use WebServer-provided Urls.

dotnet/test/webdriver/DevTools/DevToolsConsoleTests.cs

DevToolsLogTests.csUse Urls.* in DevTools log tests +1/-1

Use Urls.* in DevTools log tests

• Replaces legacy fixture URL strings with Urls.* page properties.

dotnet/test/webdriver/DevTools/DevToolsLogTests.cs

DevToolsNetworkTests.csUse Urls.* in DevTools network tests +15/-15

Use Urls.* in DevTools network tests

• Migrates navigation targets to Urls from AppServer.

dotnet/test/webdriver/DevTools/DevToolsNetworkTests.cs

DevToolsPerformanceTests.csUse Urls.* in DevTools performance tests +6/-6

Use Urls.* in DevTools performance tests

• Updates page navigation to use Urls.

dotnet/test/webdriver/DevTools/DevToolsPerformanceTests.cs

DevToolsProfilerTests.csUse Urls.* in DevTools profiler tests +3/-3

Use Urls.* in DevTools profiler tests

• Replaces legacy URL strings with Urls.* properties.

dotnet/test/webdriver/DevTools/DevToolsProfilerTests.cs

DevToolsSecurityTests.csUse Urls.* in DevTools security tests +2/-2

Use Urls.* in DevTools security tests

• Updates navigation to use Urls from the WebServer.

dotnet/test/webdriver/DevTools/DevToolsSecurityTests.cs

DevToolsTargetTests.csUse Urls.* in DevTools target tests +3/-3

Use Urls.* in DevTools target tests

• Replaces legacy fixture URL strings with Urls.* properties.

dotnet/test/webdriver/DevTools/DevToolsTargetTests.cs

DownloadsTests.csUse Urls.* in downloads tests +1/-1

Use Urls.* in downloads tests

• Updates navigation targets to use Urls from AppServer.

dotnet/test/webdriver/DownloadsTests.cs

DriverElementFindingTests.csUse Urls.* in driver element finding tests +14/-14

Use Urls.* in driver element finding tests

• Migrates navigation targets from fixture URL strings to Urls.* properties.

dotnet/test/webdriver/DriverElementFindingTests.cs

ElementAttributeTests.csUse Urls.* in element attribute tests +39/-39

Use Urls.* in element attribute tests

• Updates navigation targets to use Urls.* properties instead of legacy fixture URL strings.

dotnet/test/webdriver/ElementAttributeTests.cs

ElementElementFindingTests.csUse Urls.* in element-on-element finding tests +14/-14

Use Urls.* in element-on-element finding tests

• Replaces legacy fixture URL strings with Urls.* page properties.

dotnet/test/webdriver/ElementElementFindingTests.cs

ElementEqualityTests.csUse Urls.* in element equality tests +5/-5

Use Urls.* in element equality tests

• Updates test navigation to use Urls from the WebServer.

dotnet/test/webdriver/ElementEqualityTests.cs

ElementFindingTests.csUse Urls.* in element finding tests +111/-111

Use Urls.* in element finding tests

• Replaces extensive usage of predefined fixture URL strings with Urls.* properties and Urls.WhereIs() calls.

dotnet/test/webdriver/ElementFindingTests.cs

ElementPropertyTests.csUse Urls.* in element property tests +2/-2

Use Urls.* in element property tests

• Updates navigation targets to use Urls.* properties.

dotnet/test/webdriver/ElementPropertyTests.cs

ElementSelectingTests.csUse Urls.* in element selecting tests +17/-17

Use Urls.* in element selecting tests

• Migrates navigation targets to Urls from AppServer.

dotnet/test/webdriver/ElementSelectingTests.cs

ErrorsTests.csUse Urls.ErrorsPage in errors tests +1/-1

Use Urls.ErrorsPage in errors tests

• Replaces navigation via legacy errorsPage string with Urls.ErrorsPage.

dotnet/test/webdriver/ErrorsTests.cs

ExecutingAsyncJavascriptTests.csUse Urls.* in async JavaScript tests +28/-28

Use Urls.* in async JavaScript tests

• Replaces legacy fixture URL strings with Urls.* properties for navigation.

dotnet/test/webdriver/ExecutingAsyncJavascriptTests.cs

ExecutingJavascriptTests.csUse Urls.* in JavaScript execution tests +47/-47

Use Urls.* in JavaScript execution tests

• Updates navigation to use Urls.* properties from the WebServer.

dotnet/test/webdriver/ExecutingJavascriptTests.cs

FirefoxDriverTests.csUse Urls.* in Firefox driver tests +21/-21

Use Urls.* in Firefox driver tests

• Replaces legacy fixture URL strings with Urls.* page properties.

dotnet/test/webdriver/Firefox/FirefoxDriverTests.cs

FormHandlingTests.csUse Urls.* in form handling tests +29/-29

Use Urls.* in form handling tests

• Updates navigation targets to use Urls from AppServer.

dotnet/test/webdriver/FormHandlingTests.cs

FrameSwitchingTests.csUse Urls.* in frame switching tests +48/-48

Use Urls.* in frame switching tests

• Migrates frame/iframe-related navigations to Urls.* properties.

dotnet/test/webdriver/FrameSwitchingTests.cs

GetLogsTests.csUse Urls.* in get logs tests +3/-3

Use Urls.* in get logs tests

• Replaces legacy fixture URL strings with Urls.* properties.

dotnet/test/webdriver/GetLogsTests.cs

GetMultipleAttributeTests.csUse Urls.* in multiple attribute tests +5/-5

Use Urls.* in multiple attribute tests

• Updates navigation targets to use Urls.* page properties.

dotnet/test/webdriver/GetMultipleAttributeTests.cs

I18Tests.csUse Urls.* in i18n tests +5/-5

Use Urls.* in i18n tests

• Migrates navigation targets to Urls from the WebServer.

dotnet/test/webdriver/I18Tests.cs

IeSpecificTests.csUse Urls.* in IE-specific tests +16/-16

Use Urls.* in IE-specific tests

• Replaces legacy fixture URL strings with Urls.* properties for navigation.

dotnet/test/webdriver/IE/IeSpecificTests.cs

ImplicitWaitTests.csUse Urls.* in implicit wait tests +8/-8

Use Urls.* in implicit wait tests

• Updates navigation targets to use Urls.* properties.

dotnet/test/webdriver/ImplicitWaitTests.cs

BasicKeyboardInterfaceTests.csUse Urls.* in keyboard interaction tests +11/-11

Use Urls.* in keyboard interaction tests

• Replaces navigation targets to use Urls.* properties from AppServer.

dotnet/test/webdriver/Interactions/BasicKeyboardInterfaceTests.cs

BasicMouseInterfaceTests.csUse Urls.* in mouse interaction tests +22/-22

Use Urls.* in mouse interaction tests

• Migrates navigation targets from fixture URL strings to Urls.* properties.

dotnet/test/webdriver/Interactions/BasicMouseInterfaceTests.cs

BasicWheelInterfaceTests.csUse Urls.* in wheel interaction tests +8/-8

Use Urls.* in wheel interaction tests

• Updates navigation to use Urls.* properties from the WebServer.

dotnet/test/webdriver/Interactions/BasicWheelInterfaceTests.cs

CombinedInputActionsTests.csUse Urls.* in combined input actions tests +14/-14

Use Urls.* in combined input actions tests

• Replaces legacy fixture URL strings with Urls.* properties.

dotnet/test/webdriver/Interactions/CombinedInputActionsTests.cs

DragAndDropTests.csUse Urls.* in drag and drop tests +13/-13

Use Urls.* in drag and drop tests

• Migrates navigation targets to Urls.* properties (e.g., drag-and-drop pages).

dotnet/test/webdriver/Interactions/DragAndDropTests.cs

JavascriptEnabledBrowserTests.csUse Urls.* in JavaScript enabled browser tests +14/-14

Use Urls.* in JavaScript enabled browser tests

• Updates navigation targets to use Urls.JavascriptPage and other Urls.* properties.

dotnet/test/webdriver/JavascriptEnabledBrowserTests.cs

MiscTests.csUse Urls.* in misc WebDriver tests +12/-12

Use Urls.* in misc WebDriver tests

• Replaces legacy fixture URL strings with Urls.* properties across miscellaneous scenarios.

dotnet/test/webdriver/MiscTests.cs

NavigationTests.csUse Urls.* in navigation tests +14/-14

Use Urls.* in navigation tests

• Migrates navigation targets from fixture URL fields to Urls.* properties.

dotnet/test/webdriver/NavigationTests.cs

NetworkInterceptionTests.csUse Urls.* in network interception tests +2/-2

Use Urls.* in network interception tests

• Updates navigation targets to use Urls from AppServer.

dotnet/test/webdriver/NetworkInterceptionTests.cs

ObjectStateAssumptionsTests.csUse Urls.* in object state assumption tests +1/-1

Use Urls.* in object state assumption tests

• Replaces legacy fixture URL strings with Urls.* properties.

dotnet/test/webdriver/ObjectStateAssumptionsTests.cs

PageLoadingTests.csUse Urls.* in page loading tests +26/-26

Use Urls.* in page loading tests

• Migrates navigation targets (including redirects/sleep endpoints) to Urls.* properties and helpers.

dotnet/test/webdriver/PageLoadingTests.cs

PartialLinkTextMatchTests.csUse Urls.* in partial link text match tests +6/-6

Use Urls.* in partial link text match tests

• Updates test navigation targets to use Urls.* properties.

dotnet/test/webdriver/PartialLinkTextMatchTests.cs

PositionAndSizeTests.csUse Urls.* in position/size tests +14/-14

Use Urls.* in position/size tests

• Replaces legacy fixture URL strings with Urls.* properties for navigation.

dotnet/test/webdriver/PositionAndSizeTests.cs

PrintTests.csUse Urls.PrintPage in print tests +1/-1

Use Urls.PrintPage in print tests

• Replaces navigation via legacy printPage string with Urls.PrintPage.

dotnet/test/webdriver/PrintTests.cs

ProxySettingTests.csUse Urls.* in proxy setting tests +8/-8

Use Urls.* in proxy setting tests

• Updates page navigation to use Urls.* properties from AppServer.

dotnet/test/webdriver/ProxySettingTests.cs

RelativeLocatorTests.csUse Urls.* in relative locator tests +13/-13

Use Urls.* in relative locator tests

• Replaces legacy fixture URL strings with Urls.* page properties.

dotnet/test/webdriver/RelativeLocatorTests.cs

SelectElementHandlingTests.csUse Urls.* in select element handling tests +12/-12

Use Urls.* in select element handling tests

• Migrates navigation targets from fixture URL fields to Urls.* properties.

dotnet/test/webdriver/SelectElementHandlingTests.cs

SessionHandlingTests.csUse Urls.* in session handling tests +15/-15

Use Urls.* in session handling tests

• Updates navigation targets to use Urls from the WebServer.

dotnet/test/webdriver/SessionHandlingTests.cs

ShadowRootHandlingTests.csUse Urls.ShadowRootPage in shadow root tests +5/-5

Use Urls.ShadowRootPage in shadow root tests

• Replaces legacy shadowRootPage string with Urls.ShadowRootPage for navigation.

dotnet/test/webdriver/ShadowRootHandlingTests.cs

SlowLoadingPageTests.csUse Urls.* in slow loading page tests +3/-3

Use Urls.* in slow loading page tests

• Updates navigation targets to use Urls.* properties for slow-loading content.

dotnet/test/webdriver/SlowLoadingPageTests.cs

StaleElementReferenceTests.csUse Urls.* in stale element reference tests +7/-7

Use Urls.* in stale element reference tests

• Replaces navigation via legacy fixture URL strings with Urls.* properties.

dotnet/test/webdriver/StaleElementReferenceTests.cs

SvgDocumentTests.csUse Urls.* in SVG document tests +2/-2

Use Urls.* in SVG document tests

• Updates SVG-related page navigation to use Urls.* properties.

dotnet/test/webdriver/SvgDocumentTests.cs

SvgElementTests.csUse Urls.* in SVG element tests +2/-2

Use Urls.* in SVG element tests

• Replaces legacy fixture URL strings with Urls.* properties for SVG tests.

dotnet/test/webdriver/SvgElementTests.cs

TagNameTests.csUse Urls.* in tag name tests +1/-1

Use Urls.* in tag name tests

• Updates navigation to use Urls.* properties from AppServer.

dotnet/test/webdriver/TagNameTests.cs

TakesScreenshotTests.csUse Urls.* in screenshot tests +9/-9

Use Urls.* in screenshot tests

• Replaces fixture URL strings with Urls.* properties for navigation prior to screenshot capture.

dotnet/test/webdriver/TakesScreenshotTests.cs

TargetLocatorTests.csUse Urls.* in target locator tests +7/-7

Use Urls.* in target locator tests

• Migrates frame/iframe/window navigation targets to Urls.* properties.

dotnet/test/webdriver/TargetLocatorTests.cs

TextHandlingTests.csUse Urls.* in text handling tests +38/-38

Use Urls.* in text handling tests

• Updates navigation targets to use Urls.* properties for text-related test pages.

dotnet/test/webdriver/TextHandlingTests.cs

TextPagesTests.csUse Urls.* in text pages tests +1/-1

Use Urls.* in text pages tests

• Replaces legacy fixture URL strings with Urls.* properties for navigation.

dotnet/test/webdriver/TextPagesTests.cs

TypingTests.csUse Urls.* in typing tests +47/-47

Use Urls.* in typing tests

• Migrates navigation targets from fixture URL fields to Urls.* properties.

dotnet/test/webdriver/TypingTests.cs

UnexpectedAlertBehaviorTests.csUse Urls.* in unexpected alert behavior tests +1/-1

Use Urls.* in unexpected alert behavior tests

• Replaces legacy URL builder usage with Urls for navigation/inline page creation related to alert scenarios.

dotnet/test/webdriver/UnexpectedAlertBehaviorTests.cs

UploadTests.csUse Urls.* in upload tests +5/-5

Use Urls.* in upload tests

• Updates navigation targets (upload/transparent upload) to use Urls.* properties.

dotnet/test/webdriver/UploadTests.cs

VirtualAuthenticatorTests.csUse Urls.* in virtual authenticator tests +1/-1

Use Urls.* in virtual authenticator tests

• Replaces legacy fixture URL strings with Urls.* properties for navigation.

dotnet/test/webdriver/VirtualAuthn/VirtualAuthenticatorTests.cs

VisibilityTests.csUse Urls.* in visibility tests +22/-22

Use Urls.* in visibility tests

• Migrates navigation targets from fixture URL strings to Urls.* properties.

dotnet/test/webdriver/VisibilityTests.cs

WebElementTests.csUse Urls.* in WebElement tests +14/-14

Use Urls.* in WebElement tests

• Updates navigation targets to use Urls.* properties from AppServer.

dotnet/test/webdriver/WebElementTests.cs

WindowSwitchingTests.csUse Urls.* in window switching tests +19/-19

Use Urls.* in window switching tests

• Replaces legacy fixture URL strings with Urls.* properties for multi-window scenarios.

dotnet/test/webdriver/WindowSwitchingTests.cs

WindowTests.csUse Urls.FramesetPage and Urls.IframesPage in window tests +4/-4

Use Urls.FramesetPage and Urls.IframesPage in window tests

• Replaces framesetPage/iframePage fixture fields with Urls.* properties before window operations.

dotnet/test/webdriver/WindowTests.cs

Other (1) +1 / -0
GlobalUsings.csAdd global using for OpenQA.Selenium.Testing.WebServer +1/-0

Add global using for OpenQA.Selenium.Testing.WebServer

• Adds the WebServer namespace globally so moved UrlBuilder/InlinePage types resolve without per-file usings.

dotnet/test/webdriver/Properties/GlobalUsings.cs

@qodo-code-review

qodo-code-review Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (2) 📎 Requirement gaps (0) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 15 rules

Grey Divider


Action required

1. Urls uses EnvironmentManager.Instance ✗ Dismissed 📎 Requirement gap ☼ Reliability
Description
The updated test fixture still derives Urls from the global singleton
EnvironmentManager.Instance, preserving shared mutable test context and undermining safe parallel
execution. This conflicts with the requirement to eliminate static global test context for
parallelizable tests.
Code

dotnet/test/webdriver/BiDi/BiDiFixture.cs[34]

+    protected UrlBuilder Urls { get; } = EnvironmentManager.Instance.WebServer.Urls;
Evidence
PR Compliance ID 389278 requires removing/refactoring static global test context (specifically
EnvironmentManager) to enable parallelization. The modified BiDiTestFixture now sets Urls via
EnvironmentManager.Instance.WebServer.Urls, and the new DriverTestFixture.Urls property also
depends on EnvironmentManager.Instance, keeping the global singleton as a core dependency in the
changed lines.

Eliminate static global test context (e.g., EnvironmentManager) to enable parallelization
dotnet/test/webdriver/BiDi/BiDiFixture.cs[34-34]
dotnet/test/webdriver/DriverTestFixture.cs[28-28]

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

## Issue description
`EnvironmentManager.Instance` is still used as a global singleton source of test context (now via `Urls`), which violates the parallelization goal of removing static/shared global state.

## Issue Context
The compliance requirement explicitly calls out eliminating `EnvironmentManager`-style static/shared context to enable safe parallel test execution.

## Fix Focus Areas
- dotnet/test/webdriver/BiDi/BiDiFixture.cs[34-34]
- dotnet/test/webdriver/DriverTestFixture.cs[28-28]

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


2. UrlBuilder lacks XML <summary> 📘 Rule violation ✧ Quality
Description
New public API surface was introduced without required /// XML documentation containing a
non-empty <summary>, including the new UrlBuilder type (and its public members like HostName,
WhereIs, etc.) as well as the new public AppServer.Urls property. This violates the requirement
to document all public API members added/changed in the diff.
Code

dotnet/test/testing.webserver/UrlBuilder.cs[R29-38]

+public class UrlBuilder
+{
+    private readonly Uri _httpBaseUrl;
+    private readonly Uri _httpsBaseUrl;
+
+    public string HostName => _httpBaseUrl.Host;
+
+    public string AlternateHostName { get; }
+
+    public UrlBuilder(string httpUrl, string httpsUrl)
Evidence
PR Compliance ID 389245 requires an XML doc comment with a non-empty <summary> immediately
preceding each public type/member in the diff. The evidence indicates the newly added public
UrlBuilder declaration and its public properties/methods lack any preceding XML doc block, and the
new public Urls property on AppServer similarly has no XML documentation comment, demonstrating
non-compliance with the rule for these added public APIs.

Rule 389245: Require XML documentation with <summary> for all public API members
dotnet/test/testing.webserver/UrlBuilder.cs[29-38]
dotnet/test/testing.webserver/AppServer.cs[38-46]

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

## Issue description
Add `///` XML documentation comments with a non-empty `<summary>` for newly introduced public APIs, specifically the new `UrlBuilder` type and its public members, and the new public `Urls` property on `AppServer`.

## Issue Context
PR Compliance ID 389245 requires XML documentation with `<summary>` for all public types and members introduced or modified in the diff, and the affected public declarations currently have no XML doc comment immediately preceding them.

## Fix Focus Areas
- dotnet/test/testing.webserver/UrlBuilder.cs[29-182]
- dotnet/test/testing.webserver/AppServer.cs[44-46]

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



Remediation recommended

3. Cross-cutting test refactor 📘 Rule violation ✧ Quality
Description
The change set applies mechanical URL refactors across many unrelated test areas (e.g., Alerts,
BiDi, DevTools), reducing reviewability and making rollback harder. Consider splitting the change
into smaller, focused PRs or isolating mechanical edits from behavioral changes.
Code

dotnet/test/webdriver/AlertsTests.cs[R208-212]

+        string iframe = Urls.CreateInlinePage(new InlinePage()
            .WithBody("<a href='#' id='alertInFrame' onclick='alert(\"framed cheese\");'>click me</a>"));
-        driver.Url = EnvironmentManager.Instance.UrlBuilder.CreateInlinePage(new InlinePage()
+        driver.Url = Urls.CreateInlinePage(new InlinePage()
            .WithTitle("Testing Alerts")
            .WithBody(String.Format("<iframe src='{0}' name='iframeWithAlert'></iframe>", iframe)));
Evidence
PR Compliance ID 389267 prohibits large, cross-cutting PRs without narrowly-scoped rationale. The
diff shows repeated mechanical URL access changes across multiple distinct test areas (Alerts, BiDi,
DevTools), indicating broad cross-cutting edits in a single PR.

Rule 389267: Avoid large, cross-cutting changes in a single pull request
dotnet/test/webdriver/AlertsTests.cs[208-212]
dotnet/test/webdriver/BiDi/Session/SessionTests.cs[80-80]
dotnet/test/webdriver/DevTools/DevToolsNetworkTests.cs[128-166]

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

## Issue description
This PR is a large, cross-cutting refactor spanning many unrelated test suites, which increases risk and reduces review quality.

## Issue Context
Compliance prefers keeping PRs narrowly scoped and reversible, and separating bulk mechanical changes from any behavioral changes.

## Fix Focus Areas
- dotnet/test/webdriver/AlertsTests.cs[208-212]
- dotnet/test/webdriver/BiDi/Session/SessionTests.cs[80-80]
- dotnet/test/webdriver/DevTools/DevToolsNetworkTests.cs[128-166]

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


Grey Divider

Qodo Logo

Comment thread dotnet/test/testing.webserver/UrlBuilder.cs
Comment thread dotnet/test/webdriver/BiDi/BiDiFixture.cs
@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit a65fbdb

@nvborisenko
nvborisenko merged commit 085f7d4 into SeleniumHQ:trunk Jun 28, 2026
21 checks passed
@nvborisenko
nvborisenko deleted the dotnet-test-url-builder branch June 28, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-support Issue or PR related to support classes C-dotnet .NET Bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants