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

feat: parse msedge as well as chromedriver #297

Merged
merged 18 commits into from
Apr 13, 2023
Merged

feat: parse msedge as well as chromedriver #297

merged 18 commits into from
Apr 13, 2023

Conversation

KazuCocoa
Copy link
Member

@KazuCocoa KazuCocoa commented Apr 6, 2023

appium/appium#18449

https://github.com/appium/appium-chromium-driver can work with MSEdge as well because the msedge driver also chromium driver, but one difference is the msedge driver prints the message as:

Starting Microsoft Edge WebDriver 111.0.1661.41 (57be51b50d1be232a9e8186a10017d9e06b1fd16) on port 9515

Current sync protocol refers to the output, so msedge always handles as MJSONWP. This PR tweaks the detection logic.

After this pr, https://github.com/appium/appium-chromium-driver will be able to handle edge as below:

[debug] [Chromedriver@1d8c] Changed state to 'starting'
[Chromedriver@1d8c] Set chromedriver binary as: /Users/kazu/selenium/driver/msedgedriver_111.0.1661.41/msedgedriver
[debug] [Chromedriver@1d8c] Killing any old chromedrivers, running: pkill -15 -f "/Users/kazu/selenium/driver/msedgedriver_111.0.1661.41/msedgedriver.*--port=9515"
[Chromedriver@1d8c] No old chromedrivers seem to exist
[Chromedriver@1d8c] Spawning chromedriver with: /Users/kazu/selenium/driver/msedgedriver_111.0.1661.41/msedgedriver --port=9515 --verbose
[debug] [Chromedriver@1d8c] Microsoft Edge WebDriver version: '111.0.1661.41'
[debug] [Chromedriver@1d8c] Matched '/status' to command name 'getStatus'
[debug] [Chromedriver@1d8c] Proxying [GET /status] to [GET http://127.0.0.1:9515/status] with no body
[debug] [Chromedriver@1d8c] Got response with status 200: {"value":{"build":{"version":"111.0.1661.41 (57be51b50d1be232a9e8186a10017d9e06b1fd16)"},"message":"msedgedriver ready for new sessions.","os":{"arch":"x86_64","name":"Mac OS X","version":"10.15.7"},"ready":true}}
[Chromedriver@1d8c] Starting W3C Chromedriver session with capabilities: {
[Chromedriver@1d8c]   "capabilities": {
[Chromedriver@1d8c]     "alwaysMatch": {
[Chromedriver@1d8c]       "goog:loggingPrefs": {
[Chromedriver@1d8c]         "browser": "ALL"
[Chromedriver@1d8c]       }
[Chromedriver@1d8c]     }
[Chromedriver@1d8c]   }
[Chromedriver@1d8c] }
[debug] [Chromedriver@1d8c] Matched '/session' to command name 'createSession'

example caps:

server_url = "http://localhost:4723"
caps = {
    'browserName': 'MicrosoftEdge',
    'appium:automationName': 'chromium',
    'appium:platformName': 'macos',
    'appium:executable': '/Users/kazu/selenium/driver/msedgedriver_111.0.1661.41/msedgedriver'
}

ms:edgeOptions will be in the appium-chromium-driver side's handling.

lib/chromedriver.js Outdated Show resolved Hide resolved
lib/chromedriver.js Outdated Show resolved Hide resolved
lib/chromedriver.js Outdated Show resolved Hide resolved
@mykola-mokhnach
Copy link
Contributor

It probably also makes sense to mention the support of edge driver in README

Copy link
Member

@jlipps jlipps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree w/ @mykola-mokhnach's review

@KazuCocoa
Copy link
Member Author

Test code format diff is by pretter automatically

@KazuCocoa
Copy link
Member Author

Updated ✅

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
lib/chromedriver.js Outdated Show resolved Hide resolved
lib/chromedriver.js Outdated Show resolved Hide resolved
lib/chromedriver.js Outdated Show resolved Hide resolved
lib/chromedriver.js Outdated Show resolved Hide resolved
@KazuCocoa KazuCocoa merged commit a71240b into master Apr 13, 2023
@KazuCocoa KazuCocoa deleted the parse-msedge branch April 13, 2023 08:34
github-actions bot pushed a commit that referenced this pull request Apr 13, 2023
## [5.4.0](v5.3.4...v5.4.0) (2023-04-13)

### Features

* parse msedge as well as chromedriver ([#297](#297)) ([a71240b](a71240b))
@github-actions
Copy link
Contributor

🎉 This PR is included in version 5.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

3 participants