Skip to content

Commit 49495db

Browse files
author
Feroz Khan
committed
update element payload to fix failing tests
1 parent 211617e commit 49495db

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/commands/element.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ export async function findElOrEls(
3333
? JSON.parse(selector)
3434
: selector; // Special case
3535

36-
// If user is looking for Native IOS/Mac locator
37-
if (!isFlutterLocator && (proxyDriver instanceof XCUITestDriver || proxyDriver instanceof Mac2Driver)) {
38-
return { using: strategy, value: parsedSelector, context };
39-
} else {
36+
// Use strategy/selector format for Flutter locators and Android driver
37+
if (isFlutterLocator || proxyDriver instanceof AndroidUiautomator2Driver || proxyDriver instanceof XCUITestDriver) {
4038
return { strategy, selector: parsedSelector, context };
39+
} else {
40+
// Use using/value format for all other cases
41+
return { using: strategy, value: parsedSelector, context };
4142
}
4243
}
4344

0 commit comments

Comments
 (0)