appium-flutter-driver icon indicating copy to clipboard operation
appium-flutter-driver copied to clipboard

[Tag 2.2.2] ScrollUntilVisible don't work well

Open thuonglai opened this issue 2 years ago • 4 comments

When i update from 1.17.1 to 2.2.2. My test case worked well in version 1.17.1 but not in 2.2.2. It sometime will not work. Seem it happen when has scrollUntil before it. I guess.

  1. First case Screenshot_1700450742

I scrollUntilVisible to click answer => It work. Then I click to button Next with funtion scrollUntilTapable => It not work and raise timeout. Appium log in here: https://gist.github.com/thuonglai/4c05db4ffd70239b41385378a33491f1

  1. Second case I scrollUntilVisible to select year but it scroll till the end of list. Screenshot_1700451074

Appium log in here : https://gist.github.com/thuonglai/3482327e66dc2f8e8b435ec7a50764ef

thuonglai avatar Nov 20 '23 03:11 thuonglai

while (!isVisible && shouldRetry(startAt, waitTimeoutMilliseconds)) {
    (async () => {
      try {
        await waitFor(self, item, durationMilliseconds);
        isVisible = true;
      } catch (ign) {}
    })();

    try {
      await scroll(self, elementBase64, {
        dx: dxScroll,
        dy: dyScroll,
        durationMilliseconds,
        frequency
      });
    } catch { /* go to the next scroll */ }
  }

I think waitFor must wait in all waitTimeoutMilliseconds not in durationMilliseconds and retry. May be sometime, waitfor not execute and scroll over this element (in my second testcase). But i don't know why my first testcase happen. Button "Next" always display in 60s and waitFor not return true.

thuonglai avatar Nov 20 '23 04:11 thuonglai

This fix in 2.5.1 works great on iOS simulated devices, but fails on real physical devices hosted on browserstack. Pre 2.5.1 it failed on both real and simulated.

AYASGray avatar Apr 25 '24 17:04 AYASGray

I don't test on IOS. But it is working well on real device Android. Let me check it on IOS.

thuonglai avatar Apr 26 '24 07:04 thuonglai

@AYASGray I test it on real device iOS and it working normal.

thuonglai avatar May 10 '24 08:05 thuonglai