Skip to content

feat: restore Windows UI Automation locator for WinCore - #1380

Merged
KazuCocoa merged 4 commits into
masterfrom
wincore-locator
Nov 26, 2026
Merged

KazuCocoa merged 4 commits into
masterfrom
wincore-locator

Conversation

@KazuCocoa

Copy link
Copy Markdown
Member

Restore AppiumBy.WINDOWS_UI_AUTOMATION for WinCore's -windows uiautomation locator. This follows up on the locator discussion in #1376 and works independently of #1369.

condition = "new PropertyCondition(AutomationElement.NameProperty, 'OK')"
button = driver.find_element(AppiumBy.WINDOWS_UI_AUTOMATION, condition)

The regression test checks that the client sends the strategy and condition unchanged. All 274 unit tests passed locally. Ruff and mypy passed. Windows end-to-end behavior was not tested.

@mykola-mokhnach mykola-mokhnach left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  • No blocking issues. The new constant and ByType entry are consistent with the existing locators. The unit test checks the wire payload, and WinCore does support -windows uiautomation, new PropertyCondition(...) and the AutomationId attribute.

@@ -0,0 +1,16 @@
from appium import webdriver

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[nit] Missing the Apache license header that the sibling functional tests carry (e.g. test/functional/mac/webelement_test.py).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added the same Apache license header as the sibling functional tests in 3e1d288.

from appium.webdriver.common.appiumby import AppiumBy
from test.helpers.constants import SERVER_URL_BASE


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[minor] Does WinCore expand %SystemRoot% in appium:app? I couldn't find env-var expansion in the driver sources. If it doesn't, session creation fails, and that failure is unrelated to the locator under test. Consider the literal C:\Windows\System32\charmap.exe, or confirm the new job is green.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In 3e1d288 the test reads SYSTEMROOT on the Windows runner and passes the absolute path to appium:app, so WinCore receives a fully resolved path. The upstream WinCore test also opens Character Map and uses the same font selector (AutomationId 105).

Comment thread README.md Outdated
- https://www.selenium.dev/documentation/webdriver/actions_api/
- https://www.youtube.com/watch?v=oAJ7jwMNFVU
- Deprecated `AppiumBy.WINDOWS_UI_AUTOMATION`, which has no usage right now.
- Removed `AppiumBy.WINDOWS_UI_AUTOMATION` in v4. The locator was later restored for the WinCore driver.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[nit] "Removed in v4 … later restored" has no release number, and it sits in the v3→v4 migration list. Name the release that brings the locator back, or move the note out of the v4 removal list.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Moved the WinCore usage note to the README’s Usage section in 3e1d288. The v3→v4 migration entry now covers only the removal in v4.

@mykola-mokhnach mykola-mokhnach left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I've compiled a detailed guide for the new/old locator type: appium/appium-wincore-driver#158

We may also consider waiting until it's merged and then supply the docs link in the driver, since the locator is custom and it's not very clear how to build it w/o detailed tutorial

@KazuCocoa
KazuCocoa merged commit 52da41d into master Nov 26, 2026
10 of 14 checks passed
@KazuCocoa
KazuCocoa deleted the wincore-locator branch November 26, 2026 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants