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: Switch size retrieval to use the W3C window/rect endpoint #2538

Merged
merged 4 commits into from
Mar 24, 2025

Conversation

mykola-mokhnach
Copy link
Contributor

@mykola-mokhnach mykola-mokhnach commented Mar 23, 2025

BREAKING CHANGE: The following deprecated driver methods were removed:

  • getWindowSizeWeb
  • getWindowSizeNative

@mykola-mokhnach mykola-mokhnach merged commit cdc421f into appium:master Mar 24, 2025
12 of 17 checks passed
@mykola-mokhnach mykola-mokhnach deleted the rect branch March 24, 2025 06:58
github-actions bot pushed a commit that referenced this pull request Mar 24, 2025
## [9.0.0](v8.4.3...v9.0.0) (2025-03-24)

### ⚠ BREAKING CHANGES

* The following deprecated driver methods were removed:
- getWindowSizeWeb
- getWindowSizeNative

### Features

* Switch size retrieval to use the W3C window/rect endpoint ([#2538](#2538)) ([cdc421f](cdc421f))
Copy link
Contributor

🎉 This PR is included in version 9.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@luprochazka-cen63872
Copy link

BREAKING CHANGE: The following deprecated driver methods were removed:

  • getWindowSizeWeb
  • getWindowSizeNative

Hi @mykola-mokhnach , could you please explain why these methods were removed? I'm using Appium together with RobotFramework's AppiumLibrary. One of the keywords in the library, Swipe By Percent, uses the methods self.get_window_width and get_window_height under the hood. Everything works fine with version 8, but breaks with the latest version.

HandlerExecutionFailed: UnknownMethodException: Message: Unhandled endpoint: /session/C558FDFF-2FDB-4181-9B8B-5CC652534362/window/rect -- http://127.0.0.1:62413/ with parameters {
    wildcards =     (
        "session/C558FDFF-2FDB-4181-9B8B-5CC652534362/window/rect"
    );
}
Stacktrace:
UnknownCommandError: Unhandled endpoint: /session/C558FDFF-2FDB-4181-9B8B-5CC652534362/window/rect -- http://127.0.0.1:62413/ with parameters {
    wildcards =     (
        "session/C558FDFF-2FDB-4181-9B8B-5CC652534362/window/rect"
    );
}
    at errorFromW3CJsonCode (/Users/cen63872/.appium/node_modules/appium-xcuitest-driver/node_modules/@appium/base-driver/lib/protocol/errors.js:1110:25)
    at ProxyRequestError.getActualError (/Users/cen63872/.appium/node_modules/appium-xcuitest-driver/node_modules/@appium/base-driver/lib/protocol/errors.js:979:14)
    at JWProxy.command (/Users/cen63872/.appium/node_modules/appium-xcuitest-driver/node_modules/@appium/base-driver/lib/jsonwp-proxy/proxy.js:357:19)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at XCUITestDriver.proxyCommand (/Users/cen63872/.appium/node_modules/appium-xcuitest-driver/lib/commands/proxy-helper.js:100:35)
    at XCUITestDriver.getWindowRect (/Users/cen63872/.appium/node_modules/appium-xcuitest-driver/lib/commands/general.js:123:7)

@KazuCocoa
Copy link
Member

That was moved to w3c webdriver endpoint. Btw, this change is between xcuitest driver and Appium/WDA mostly. Could you share the full appium server log? I guess you used old Appium/WDA (lower than Appium/WDA 9.3.0, which is not bundled in the xcuitest driver 9.0.0 https://www.npmjs.com/package/appium-xcuitest-driver/v/9.0.0?activeTab=code) with xcodebuild driver 9.0.0.

https://github.com/appium/WebDriverAgent/blob/master/CHANGELOG.md#930-2025-03-21

@luprochazka-cen63872
Copy link

Thanks! I am using Appium 2.17.1 Could you explain more about the connection between Appium, WDA, and the XCUITest driver? Is there any way how to check the version of WDA? I’ve noticed it works with Appium when I don’t use the Appium Device Farm plugin. I don't know the details of how it works inside the plugin.

@KazuCocoa
Copy link
Member

KazuCocoa commented Mar 28, 2025

Appium XCUITest driver communicates with a client. Appium XCUITest driver communicates with Appium/WDA, which is running on a device to handle the app under test. Appium server log has info on what WDA is running on the device.

I don't know about the plugin internal so if the issue occurs with the plugin only, I'd recommend reporting this behavior to the plugin author to update them with the latest XCUITest driver and its deps.

@luprochazka-cen63872
Copy link

I’ve fixed it. Device Farm requires the WDA to be signed, and for this purpose, the authors provided the following command:

appium plugin run device-farm prepare-wda --mobile-provisioning-file=/Users/cen63872/Desktop/comcoetWebDriverAgentRunnerxctrunner_Dev.mobileprovision

However, this build might lead to WDA becoming outdated, as I’ve just found out.

Before:

[ec062847][WD Proxy] Got response with status 200: {"value":{"build":{"version":"8.9.4","time":"Nov 26 2024 15:03:03","productBundleIdentifier":"com.facebook.WebDriverAgentRunner.xctrunner"},"os":{"testmanagerdVersion":65535,"name":"iPadOS","sdkVersion":"18.0","version":"18.4"},"device":"ipad","ios":{"ip":"192.168.2.56"},"message":"WebDriverAgent is ready to accept commands","state":"success","ready":true},"sessionId":null}

After:

[23d5d291][WD Proxy] Got response with status 200: {"value":{"build":{"version":"9.3.3","time":"Mar 28 2025 11:39:27","productBundleIdentifier":"com.coet.WebDriverAgentRunner.xctrunner"},"os":{"testmanagerdVersion":65535,"name":"iPadOS","sdkVersion":"18.0","version":"18.4"},"device":"ipad","ios":{"ip":"192.168.2.56"},"message":"WebDriverAgent is ready to accept commands","state":"success","ready":true},"sessionId":null}

So, you were absolutely right — thanks a lot for your advice!

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