This error typically happens when I try to perform a gesture action like swipe, drag, or flick.
package Tests;
import java.util.HashMap;
import java.util.Map;
import org.testng.annotations.Test;
import Keys.TestKeys;
import Pages.Customer;
import basetest.BaseTest;
import io.github.ashwith.flutter.FlutterElement;
import io.github.ashwith.flutter.FlutterFinder;
public class customerTest extends BaseTest {
@Test
public void Scroll() throws InterruptedException {
Customer custom = new Customer(driver);
custom.tapCustomerModule();
FlutterFinder finder = new FlutterFinder(driver);
Thread.sleep(5000);
FlutterElement customerList = finder.byValueKey(TestKeys.customerListPageTestKeys.customerList);
// Build finder JSON for the scrollable element
Map<String, Object> finderJson = new HashMap<>();
finderJson.put("finderType", "ByValueKey");
finderJson.put("keyValueString", customerList);
finderJson.put("keyValueType", "String");
// Build scroll command with proper params
Map<String, Object> scrollCommand = new HashMap<>();
scrollCommand.put("finder", finderJson);
scrollCommand.put("dx", 0);
scrollCommand.put("dy", -300);
scrollCommand.put("durationMilliseconds", 500);
scrollCommand.put("frequency", 60);
// Execute scroll
driver.executeScript("flutter:scroll", scrollCommand);
Thread.sleep(2000); // wait to observe scroll
}
}
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Cannot destructure property ‘dx’ of ‘opts’ as it is undefined.