Skip to content

Conversation

bonigarcia
Copy link
Member

@bonigarcia bonigarcia commented Oct 2, 2025

User description

🔗 Related Issues

Fixes #16215.

💥 What does this PR do?

This PR makes SM to log the browser path even when offline mode is specified:

./selenium-manager --browser chrome --debug --offline --output json --clear-cache
{
  "logs": [
    {
      "level": "DEBUG",
      "timestamp": 1759397333,
      "message": "Offline flag set, but also asked not to avoid browser downloads. Honouring offline flag"
    },
    {
      "level": "DEBUG",
      "timestamp": 1759397333,
      "message": "Using Selenium Manager in offline mode"
    },
    {
      "level": "DEBUG",
      "timestamp": 1759397333,
      "message": "Clearing cache at: C:\\Users\\boni\\.cache\\selenium"
    },
    {
      "level": "DEBUG",
      "timestamp": 1759397333,
      "message": "chromedriver not found in PATH"
    },
    {
      "level": "DEBUG",
      "timestamp": 1759397333,
      "message": "chrome detected at C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
    },
    {
      "level": "DEBUG",
      "timestamp": 1759397333,
      "message": "Detected browser: chrome 140.0.7339.208"
    },
    {
      "level": "WARN",
      "timestamp": 1759397333,
      "message": "Unable to discover proper chromedriver version in offline mode"
    },
    {
      "level": "INFO",
      "timestamp": 1759397333,
      "message": "Browser path: C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
    }
  ],
  "result": {
    "code": 0,
    "message": "",
    "driver_path": "",
    "browser_path": "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
  }
}

🔧 Implementation Notes

💡 Additional Considerations

🔄 Types of changes

  • Bug fix (backwards compatible)

PR Type

Bug fix


Description

  • Log browser path in offline mode when driver discovery fails

  • Extract browser path logging into separate function

  • Ensure consistent browser path reporting across all execution paths


Diagram Walkthrough

flowchart LR
  A["Offline Mode"] --> B["Driver Discovery Fails"]
  B --> C["Extract Browser Path"]
  C --> D["Log Browser Path"]
  D --> E["Exit with Status"]
Loading

File Walkthrough

Relevant files
Bug fix
main.rs
Add browser path logging in offline mode                                 

rust/src/main.rs

  • Extract browser path early in error handling flow
  • Create dedicated log_browser_path function for reusability
  • Add browser path logging in offline mode error path
  • Refactor existing logging to use new function
+7/-1     

@bonigarcia bonigarcia added C-rust Rust code is mostly Selenium Manager B-manager Selenium Manager labels Oct 2, 2025
@bonigarcia bonigarcia moved this to In Progress in Selenium Manager Oct 2, 2025
Copy link
Contributor

qodo-merge-pro bot commented Oct 2, 2025

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🟡
🎫 #1234
🔴 Investigate and fix regression where clicking a link with JavaScript in href no longer
triggers in Selenium 2.48.x on Firefox 42 compared to 2.47.1.
Provide a reproducible test or verification that alerts fire as expected when clicking
such links.
🟡
🎫 #5678
🔴 Diagnose and resolve intermittent "ConnectFailure (Connection refused)" errors when
instantiating additional ChromeDriver instances on Ubuntu 16.04 with Chrome
65/ChromeDriver 2.35 and Selenium 3.9.0.
Provide guidance or code changes to ensure subsequent ChromeDriver instantiations succeed
without connection errors.
Validate fix across multiple sequential ChromeDriver instantiations.
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
No custom compliance provided

Follow the guide to enable custom compliance check.

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

Copy link
Contributor

qodo-merge-pro bot commented Oct 2, 2025

PR Code Suggestions ✨

No code suggestions found for the PR.

@bonigarcia bonigarcia merged commit 2eeadab into trunk Oct 2, 2025
32 checks passed
@bonigarcia bonigarcia deleted the sm_log_browser_offline branch October 2, 2025 10:06
@github-project-automation github-project-automation bot moved this from In Progress to Done in Selenium Manager Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-manager Selenium Manager C-rust Rust code is mostly Selenium Manager Review effort 2/5

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[🐛 Bug]: [rust] Selenium Manager does not return browser path without driver

1 participant