How to scroll by coordinates using nightwatchJs for Android?

I have tried many ways but no luck. please suggest.

browser.executeScript(
‘mobile: scrollGesture’,
{
startX: 100,
startY: 500,
endX: 100,
endY: 100,
direction: ‘down’,
percent: 1.0
}
);

try this

Dimension dimension = driver.manage().window().getSize();
((JavascriptExecutor) driver).executeScript(“mobile: scrollGesture”, ImmutableMap.of(
“left”, (int)(dimension.width * 0.1),
“top”, (int)(dimension.height * 0.2),
“width”, (int)(dimension.width * 0.8),
“height”, (int)(dimension.height * 0.7),
“direction”, “down”,
“percent”, 1.0,
“speed”, 500
));

Getting syntax error as below:

:heavy_multiplication_x: SyntaxError
Unexpected identifier ‘dimension’
/Nightwatch/nightwatch/examples/mobile-app-tests/validate_category_subcategory_equip_kit_content_android.js:136
Dimension dimension = driver.manage().window().getSize();

okeyy
sorry, but no experience with nightwatchJs

1 Like

Hello Yashwant_Rathore1, did u figure out how to scroll on Nightwatch.js for android?