# Appium Gesture Command Fails with "Cannot destructure property 'dx' of 'opts' as it is undefined" Error

**URL:** <https://discuss.appium.io/t/appium-gesture-command-fails-with-cannot-destructure-property-dx-of-opts-as-it-is-undefined-error/45783>\
**Category:** Issues/Bugs\
**Created:** [May 27, 2025, 4:44am UTC](https://discuss.appium.io/t/appium-gesture-command-fails-with-cannot-destructure-property-dx-of-opts-as-it-is-undefined-error/45783 "2025-05-27T04:44:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pavanm](https://discuss.appium.io/user_avatar/discuss.appium.io/pavanm/32/14194_2.png) [@Pavanm](https://discuss.appium.io/u/Pavanm)\
**Post date:** [May 27, 2025, 4:44am UTC](https://discuss.appium.io/t/appium-gesture-command-fails-with-cannot-destructure-property-dx-of-opts-as-it-is-undefined-error/45783/1 "2025-05-27T04:44:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![wreed](https://discuss.appium.io/letter_avatar_proxy/v4/letter/w/919ad9/32.png) [@wreed](https://discuss.appium.io/u/wreed)\
**Post date:** [May 27, 2025, 3:41pm UTC](https://discuss.appium.io/t/appium-gesture-command-fails-with-cannot-destructure-property-dx-of-opts-as-it-is-undefined-error/45783/2 "2025-05-27T15:41:36Z")

</div>

Full server log, please. Also, what version of Flutter?

---

<div class="post-metadata">

**Author:** ![wreed](https://discuss.appium.io/letter_avatar_proxy/v4/letter/w/919ad9/32.png) [@wreed](https://discuss.appium.io/u/wreed)\
**Post date:** [May 28, 2025, 3:33pm UTC](https://discuss.appium.io/t/appium-gesture-command-fails-with-cannot-destructure-property-dx-of-opts-as-it-is-undefined-error/45783/3 "2025-05-28T15:33:24Z")

</div>

I see this is working now, posting in case someone has the same error and is looking for the solution:

> <https://github.com/appium/appium-flutter-driver/issues/800>
>
> private void performScroll(FlutterElement element, int dx, int dy, int duration,… int frequency) {
> // Print scroll parameters for debugging
> System.out.println("Performing scroll with params: dx=" + dx + ", dy=" + dy + ", scrollableId=" + element.getId());
> 
> 
> Map\<String, Object\> scrollParams = new HashMap\<\>();
> scrollParams.put("dx", 0);
> scrollParams.put("dy", -300);
> scrollParams.put("duration", 200);
> scrollParams.put("frequency", 60);
> scrollParams.put("scrollableId", element.getId());
>         
> System.out.println("Scroll params: " + scrollParams);
> 
> driver.executeScript("flutter:scroll", scrollParams);
>         
> when trying to scroll the flutter elemet in Appium v2.18.0 with flutter driver getting this issue "\[ERROR\] Test failed: An unknown server-side error occurred while processing the command. Original error: Cannot destructure property 'dx' of 'opts' as it is undefined."

---

<div class="post-metadata">

**Author:** ![Pavanm](https://discuss.appium.io/user_avatar/discuss.appium.io/pavanm/32/14194_2.png) [@Pavanm](https://discuss.appium.io/u/Pavanm)\
**Post date:** [June 5, 2025, 4:02am UTC](https://discuss.appium.io/t/appium-gesture-command-fails-with-cannot-destructure-property-dx-of-opts-as-it-is-undefined-error/45783/4 "2025-06-05T04:02:22Z")

</div>

I tried this approach now it is working
