Hi.
When I try to swipe a view by it's type and index detox simply ignores the index and gives me a 'Multiple UI elements matched for the criteria' error .
I don麓t have access to the apps code so I can麓t put a testId on the view.
My code:
await element(by.type('UINavigationTransitionView')).atIndex(0).swipe('right', 'fast');
error:
1) Test:
Error: Error: Multiple UI elements matched for the given criteria.
Exception with Action: {
"Action Name" : "Swipe Right for duration 0.1",
"Element Matcher" : "((((kindOfClass('UINavigationTransitionView') && !(kindOfClass('RCTScrollView'))) || (kindOfClass('UIScrollView') && ((kindOfClass('UIView') || respondsToSelector(accessibilityContainer)) && ancestorThatMatches((kindOfClass('UINavigationTransitionView') && kindOfClass('RCTScrollView')))))) && !(kindOfClass('RCTScrollView'))) || (kindOfClass('UIScrollView') && ((kindOfClass('UIView') || respondsToSelector(accessibilityContainer)) && ancestorThatMatches((((kindOfClass('UINavigationTransitionView') && !(kindOfClass('RCTScrollView'))) || (kindOfClass('UIScrollView') && ((kindOfClass('UIView') || respondsToSelector(accessibilityContainer)) && ancestorThatMatches((kindOfClass('UINavigationTransitionView') && kindOfClass('RCTScrollView')))))) && kindOfClass('RCTScrollView'))))))",
"Recovery Suggestion" : "Create a more specific matcher to uniquely match an element. If that's not possible then use atIndex: to select from one of the matched elements but the order of elements may change."
}
Error Trace: [
{
"Description" : "Multiple elements were matched: (
"
"
"
). Please use selection matchers to narrow the selection down to single element.",
"Error Domain" : "com.google.earlgrey.ElementInteractionErrorDomain",
"Error Code" : "5",
"File Name" : "GREYElementInteraction.m",
"Function Name" : "-[GREYElementInteraction grey_errorForMultipleMatchingElements:withMatchedElementsIndexOutOfBounds:]",
"Line" : "956"
}
]
at Client._callee8$ (node_modules/detox/lib/client/Client.js:57:19)
at tryCatch (node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js:65:40)
at Generator.invoke [as _invoke] (node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js:303:22)
at Generator.prototype.(anonymous function) [as throw] (node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js:117:21)
at step (node_modules/detox/lib/client/Client.js:1:809)
at node_modules/detox/lib/client/Client.js:1:1008
at
at process._tickCallback (internal/process/next_tick.js:188:7)
child_process.js:641
throw err;
^
Error: Command failed: node_modules/.bin/mocha e2e --opts e2e/mocha.opts
Detox: 5.9.2
Node: 8.8.1
Device: iPhone 6 (simulator)
Xcode: 9.0.1
macOS: Sierra 10.12.6
I was just about to report the same, but for scrollTo instead of swipe.
I'm having problem with this:
await element(by.type('RCTScrollView')).atIndex(0).scrollTo('bottom');
I get "Multiple elements were matched"
But this is okay:
await expect(element(by.type('RCTScrollView')).atIndex(0)).toBeVisible();
I have the same issue with nested scrollView:
const scrollView = element(by.id('scene.id.base').and(by.type('RCTScrollView'))).atIndex(0);
await expect(scrollView).toBeVisible();
await expect(scrollView).toExist();
toBeVisible and toExist work properly, but scroll/scrollTo/swipe do not work:
await scrollView.scroll(100, 'down');
A part of the logs:
Error Trace: [
{
"Description" : "Multiple elements were matched: (
"<RCTCustomScrollView:0x7fb877a6d400; AX=N; AX.frame={{0, 110}, {375, 517}} <...>
"<RCTCustomScrollView:0x7fb877aade00; AX=N; AX.frame={{0, 477}, {375, 106}} <...>
"<RCTCustomScrollView:0x7fb87721ae00; AX=N; AX.frame={{0, 707.5}, {375, 751.5}} <...>
). Please use selection matchers to narrow the selection down to single element."
I think there are generally problems around matching scrollviews. I'm also keeping an eye on this one: https://github.com/wix/detox/issues/164
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back.
Thank you for your contributions.
This might be a dupe of #164, but I think this is still relevant.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back.
Thank you for your contributions.
Still not working on latest Detox.
I can confirm this is still not working.
scroll, scrollTo, swipe ignore atIndex(0). Though tap regards atIndex(0).
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back.
Thank you for your contributions.
Please unstale, this is still an issue :)
Confirmed still an issue, pasted error below
React 16.3.1
RN 0.55.4
node 9.2.0
Detox 7.3.7
Error: Multiple UI elements matched for the given criteria.
Exception with Action: {
"Action Name" : "Scroll To Bottom content edge",
"Element Matcher" : "(((((kindOfClass('UIScrollView') || kindOfClass('UIWebView')) && (respondsToSelector(accessibilityIdentifier)&& accessibilityID('scrollView'))) || (kindOfClass('UIScrollView') && ((kindOfClass('UIView') || respondsToSelector(accessibilityContainer)) && ancestorThatMatches((respondsToSelector(accessibilityIdentifier) && accessibilityID('scrollView')))))) && !(kindOfClass('RCTScrollView'))) || (kindOfClass('UIScrollView') && ((kindOfClass('UIView') || respondsToSelector(accessibilityContainer)) && ancestorThatMatches(((((kindOfClass('UIScrollView') || kindOfClass('UIWebView')) && (respondsToSelector(accessibilityIdentifier) && accessibilityID('scrollView'))) || (kindOfClass('UIScrollView') && ((kindOfClass('UIView') || respondsToSelector(accessibilityContainer)) && ancestorThatMatches((respondsToSelector(accessibilityIdentifier) && accessibilityID('scrollView')))))) && kindOfClass('RCTScrollView'))))))",
"Recovery Suggestion" : "Create a more specific matcher to uniquely match an element. If that's not possible then use atIndex: to select from one of the matched elements but the order of elements may change."
}
Error Trace: [
{
"Description" : "Multiple elements were matched: (
"<RCTCustomScrollView:0x7fb8a2830800; AX=N; AX.frame={{-750, 0}, {375, 695}}; AX.activationPoint={-562.5, 347.5}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 695}}; opaque; alpha=1>",
"<RCTCustomScrollView:0x7fb8a1234800; AX=N; AX.frame={{0, 44}, {375, 651}}; AX.activationPoint={187.5, 369.5}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 651}}; opaque; alpha=1>",
"<RCTCustomScrollView:0x7fb8a10a7800; AX=N; AX.frame={{-750, 1327.3333129882812}, {375, 360}}; AX.activationPoint={-562.5, 1507.3333129882812}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 360}}; opaque; alpha=1>",
"<RCTCustomScrollView:0x7fb8a1099a00; AX=N; AX.frame={{-740, 498}, {355, 330}}; AX.activationPoint={-562.5, 663}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {355, 330}}; opaque; alpha=1>"
). Please use selection matchers to narrow the selection down to single element.",
"Error Domain" : "com.google.earlgrey.ElementInteractionErrorDomain",
"Error Code" : "5",
"File Name" : "GREYElementInteraction.m",
"Function Name" : "-[GREYElementInteraction grey_errorForMultipleMatchingElements:withMatchedElementsIndexOutOfBounds:]",
"Line" : "956"
}
]
The fact that @ma-pe found different behaviours in tap and other actions is pretty odd.
The implementation is generic for all actions, and the underlying EarlGrey implementation seems generic as well.
same issue.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back.
Thank you for your contributions.
The issue has been closed for inactivity.
unstale unclose.
I'll try to setup something for reproducing the issue in the next days.
Multiple elements issues have been resolved recently. Please try a new build and if it still occurs, open a new issue, rather than bumping an old one. Thanks
Most helpful comment
Please unstale, this is still an issue :)