Skip to content

[🐛 Bug]: XCUITest driver only supports W3C actions execution in native context #14590

@simoDama

Description

@simoDama

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

9.15.0 with typescript

Node.js Version

v22.14.0

Mode

WDIO Testrunner

Which capabilities are you using?

What happened?

I'm testing a hybrid mobile app built with Ionic, Angular, and Capacitor. I'm trying to execute a longPress() method on an element inside an iOS WebView, but I encounter an error when executing the action.

The version of appium-xcuitest-driver is 8.3.1. Even after upgrading to the latest version of the XCUITest driver, the error persists.

The same action works correctly on the Android version of the app. Since I can't access the element in the native context, I'm using browser.execute() with a JavaScript TouchEvent to perform the action manually.

What is your expected behavior?

If I use the longPress method, according to the documentation https://webdriver.io/it/docs/api/mobile/longPress,
I need to perform a long press on an element—just like on Android.

How to reproduce the bug.

export async function longPress(id: string) {
 //get the element by selector ID
  const element = await getElementById({ id: id });
 //perform long press
  await element.longPress({ duration: 10000 });
}

Relevant log output

Error: [0-0]  WARN webdriver: WebDriverError: The XCUITest driver only supports W3C actions execution in the native context. Although, your W3C action contains one or more web elements, which cannot be automatically mapped to the native context. Consider mapping their absolute web coordinates to native context coordinates and passing them to your gesture instead.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Metadata

Metadata

Assignees

Labels

Bug 🐛Needs InvestigationIssues that require more information on the problem.help wantedIssues that are free to take by anyone interested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions