microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
67.27k stars 3.7k forks source link

[Feature]: Android uiautimator selectors #33498

Open mstankovic opened 3 weeks ago

mstankovic commented 3 weeks ago

🚀 Feature Request

Im using Playwright for Android testing (hybrid app) and have difficulty to locate selectors. If Im correct playwright only accepts resource-id selector type but not other types as xpath or uiautomator..

P.S. If I dont have resource-id im unable to locate element, so Im unable to locate "Email" input field form screenshot.

Attached screenshot is webview and even not able to do:

// Work with WebView's page as usual.
const page = await webview.page();

Image

Example

No response

Motivation

More people interested in mobile automation will start using Playwright

yury-s commented 2 weeks ago

If Im correct playwright only accepts resource-id selector type but not other types as xpath or uiautomator..

You can get a list of all webViews and select yours based on pkg property. There is no better way today unfortunately.