Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rust] Include webview2 in Edge module #12904

Merged
merged 1 commit into from
Oct 9, 2023
Merged

[rust] Include webview2 in Edge module #12904

merged 1 commit into from
Oct 9, 2023

Conversation

bonigarcia
Copy link
Member

Description

This PR includes the label webview2 as synonymous of Microsoft Edge in the Edge module.

This way, Selenium Manager can be invoked using --browser webview2. As requested in #issues, in this case, Selenium Manager will treat webview2 like Microsoft Edge for getting the driver but returning an empty string for the browser's location instead of trying to obtain it. For instance:

./selenium-manager --debug --browser webview2
DEBUG   msedgedriver not found in PATH
DEBUG   webview2 detected at C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe
DEBUG   Running command: wmic datafile where name='C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe' get Version /value
DEBUG   Output: "\r\r\n\r\r\nVersion=117.0.2045.60\r\r\n\r\r\n\r\r\n\r"
DEBUG   Detected browser: webview2 117.0.2045.60
DEBUG   Required driver: msedgedriver 117.0.2045.60
DEBUG   msedgedriver 117.0.2045.60 already in the cache
INFO    Driver path: C:\Users\boni\.cache\selenium\msedgedriver\win64\117.0.2045.60\msedgedriver.exe
./selenium-manager --browser webview2 --output json
{
  "logs": [
    {
      "level": "INFO",
      "timestamp": 1696863192,
      "message": "Driver path: C:\\Users\\boni\\.cache\\selenium\\msedgedriver\\win64\\117.0.2045.60\\msedgedriver.exe"
    }
  ],
  "result": {
    "code": 0,
    "message": "C:\\Users\\boni\\.cache\\selenium\\msedgedriver\\win64\\117.0.2045.60\\msedgedriver.exe",
    "driver_path": "C:\\Users\\boni\\.cache\\selenium\\msedgedriver\\win64\\117.0.2045.60\\msedgedriver.exe",
    "browser_path": ""
  }
}

Motivation and Context

This issue will support WebView2, as requested in #12738.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@titusfortner titusfortner merged commit 5e64286 into trunk Oct 9, 2023
49 of 51 checks passed
@titusfortner titusfortner deleted the sm_webview2 branch October 9, 2023 20:18
aguspe pushed a commit to aguspe/selenium that referenced this pull request Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants