feat: support 'goog:loggingPrefs' value when creating a session #954
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem: Able to receive performance log types and get performance logs when using Mobile JSON Wire protocol but unable to do the same when using W3C.
Reason: The logging preferences are set using "goog:LoggingPrefs" in Selenium capability. "
[enablePerformanceLogging](https://github.com/appium/appium-android-driver/blob/92b51340cd976a73cb60530d6cdd6d43414b939a/lib/commands/context/helpers.js#L208)
" is deprecated and Selenium 4 does not allow passing it. However, the Appium Android driver did not account for it and set it correctly to pass it to the Appium Chromedriver. Thus, the ChromeDriver would not receive it and then create a default session with the default logging preferences i.e.{browser: ALL}
.Logs (when trying to use the Appium server):
Capabilities sent:
22024-08-28 14:12:36:753 - [HTTP] {"capabilities":{"firstMatch":[{"goog:chromeOptions":{"args":["--proxy-bypass-list=<-loopback>","test-type","--proxy-server=http://[REDACTED]","--disable-features=Translate"]},"newCommandTimeout":0,"goog:loggingPrefs":{"performance":"ALL"},"appium:skipServerInstallation":"true","platformName":"Android","deviceName":"android","browserName":"chrome"}]}}
Capabilities when creating a ChromeDriver session capabilities:
Note that the capabilities sent while creating a ChromeDriver session do not contain the logging preferences:
"performance": "ALL”
but only the default value"browser": "ALL"
. This change fixes it in the Android appium driver.