No matter what I try, I am unable to get my React Native (Android) app to scroll down using Appium.
I am using UiAutomator2 and WebdriverIO.
My code looks like this:
scrollUntilDisplayed(element: WebdriverIO.Element) {
const dimensions = driver.getWindowSize();
touchScroll(10, 100);
}
In place of touchScroll
, I have tried the following calls:
driver.touchScroll(offsetX, offsetY)
- throws an error (invalid argument: java.lang.IllegalArgumentException: ScrollToModel: The mandatory field 'params' is not present in JSON
)driver.touchScroll(offsetX, offsetY, element)
- throws an error (invalid argument: java.lang.IllegalArgumentException: ScrollToModel: The mandatory field 'params' is not present in JSON
)browser.execute("mobile: scroll", {direction: 'down'});
- throws an error (unknown error: An unknown server-side error occurred while processing the command. Original error: Both strategy and selector arguments must be provided
)driver.touchFlick(0, dimensions.height, undefined, 10000, 10000, 10000);
- does nothing; sits until Appium times outelement.scrollIntoView();
- does nothing
description
, as I'd rather gear towards querying Accessibility Labels than inner text. But both work exactly as intended :) – Jorin