Repository navigation
Conversation
AppiumOptions.__init__ assigned default_capabilities straight to _caps, so driver defaults such as automationName were stored under the bare key, while the automation_name setter (via set_capability) writes appium:automationName. As a result: - UiAutomator2Options() then automation_name = 'Espresso' left both keys in to_capabilities(), and the getter still returned the default 'UIAutomator2' because get_capability checks the bare key first. - automation_name = None removed only the prefixed key, so the default was still sent to the server. Load the defaults through load_capabilities so they get the same W3C names as every other capability. platformName is a W3C capability and stays unprefixed. to_capabilities() now returns appium:automationName instead of automationName; the to_w3c() request body is unchanged, except that clearing automation_name now really removes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Driver options such as
UiAutomator2Optionsstore their defaultautomationNameunder the bare key, becauseAppiumOptions.__init__assignsdefault_capabilitiesstraight to_caps. Theautomation_namesetter goes throughset_capability, which writesappium:automationName. So the two never meet:Clearing
automation_nameremoves only the prefixed key, so the default is still sent to the server. The same happens for every options class with a default: Espresso, XCUITest, Safari, Mac2, Windows, Gecko and FlutterIntegration.Fix
Load the defaults through
load_capabilities, so they get the same W3C names as every other capability.platformNameis a W3C capability and stays unprefixed.Behaviour change:
to_capabilities()now returnsappium:automationNameinstead ofautomationName, for example{'appium:automationName': 'UIAutomator2', 'platformName': 'Android'}. Code that readsto_capabilities()['automationName']directly needs updating;get_capability('automationName')and theautomation_nameproperty work as before. Theto_w3c()request body is unchanged, except that settingautomation_name = Nonenow really removes it.Tests
appium:automationName(andplatformNameunprefixed), thatto_w3c()still sends the same body, that settingautomation_namereplaces the default, and that setting it toNoneremoves it. Without the fix they fail with, for example,assert 'UIAutomator2' == 'Espresso'.to_w3c()output before and after the fix for every options class, with default, overridden and loaded automation names. It only differs whenautomation_nameis set toNone.to_capabilities().ruff check,ruff format --check,mypy appiumand the full unit test suite pass.🤖 Generated with Claude Code