Skip to content

Conversation

@nvborisenko
Copy link
Member

@nvborisenko nvborisenko commented Jul 17, 2025

User description

… of low level

🔗 Related Issues

Contributes to #15612

💥 What does this PR do?

Remove unnecessary extra methods from low-level BiDi API.


PR Type

Enhancement


Description

  • Remove NavigateBackAsync and NavigateForwardAsync methods from BiDi BrowsingContext

  • Simplify low-level BiDi API by removing convenience methods

  • Users should use TraverseHistoryAsync with delta values directly


Diagram Walkthrough

flowchart LR
  A["BrowsingContext"] --> B["NavigateBackAsync (removed)"]
  A --> C["NavigateForwardAsync (removed)"]
  A --> D["TraverseHistoryAsync (kept)"]
  B -.-> D
  C -.-> D
Loading

File Walkthrough

Relevant files
Enhancement
BrowsingContext.cs
Remove navigation convenience methods                                       

dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContext.cs

  • Removed NavigateBackAsync method that called TraverseHistoryAsync(-1)
  • Removed NavigateForwardAsync method that called
    TraverseHistoryAsync(1)
  • Kept core TraverseHistoryAsync method for history navigation
+0/-10   

@selenium-ci selenium-ci added the C-dotnet .NET Bindings label Jul 17, 2025
@qodo-merge-pro
Copy link
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

15612 - Partially compliant

Compliant requirements:

• Remove complexity-hiding convenience methods to expose spec-defined capabilities
• Allow users to access native low-level methods directly

Non-compliant requirements:

• Revisit all internal modifiers and make them public
• Move all "helpers/extensions" to OpenQA.Selenium.BiDi.Extensions namespace

Requires further human verification:

• Verify that removing these convenience methods doesn't break existing user code
• Confirm this change aligns with the broader BiDi API refactoring strategy

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Breaking Change

Removing public methods NavigateBackAsync and NavigateForwardAsync is a breaking change that may affect existing users. Consider deprecation strategy or version compatibility.

public Task TraverseHistoryAsync(int delta, TraverseHistoryOptions? options = null)
{
    return BiDi.BrowsingContext.TraverseHistoryAsync(this, delta, options);
}

public Task SetViewportAsync(SetViewportOptions? options = null)
{
    return BiDi.BrowsingContext.SetViewportAsync(this, options);
}

@qodo-merge-pro
Copy link
Contributor

PR Code Suggestions ✨

No code suggestions found for the PR.

@nvborisenko
Copy link
Member Author

CI is failing due to not related to this changes.

Merging without review with strong argument: if we have NavigateBack then we should have NavigateDoubleBack.

@nvborisenko nvborisenko merged commit 5dfda93 into SeleniumHQ:trunk Jul 17, 2025
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants