# Scrolling is not working on nested scrollview c# android

**URL:** <https://discuss.appium.io/t/scrolling-is-not-working-on-nested-scrollview-c-android/23729>\
**Category:** Issues/Bugs\
**Created:** [September 28, 2018, 12:14pm UTC](https://discuss.appium.io/t/scrolling-is-not-working-on-nested-scrollview-c-android/23729 "2018-09-28T12:14:06Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![karolina](https://discuss.appium.io/user_avatar/discuss.appium.io/karolina/32/4801_2.png) [@karolina](https://discuss.appium.io/u/karolina)\
**Post date:** [September 28, 2018, 12:14pm UTC](https://discuss.appium.io/t/scrolling-is-not-working-on-nested-scrollview-c-android/23729/1 "2018-09-28T12:14:06Z")

</div>

Hi everyone!

I have problem with scrolling view in android app.  
Code is performed properly but screen is not moved. I thing that the problem could be related with fact that it is nested scroll view which alows scrolling and swipeing.

Have any one deal with it? Is there any workaroud? Or maybe Is there any hot fix on the developers side?

This is what I know for now:

- appium tells me that scroll was performed properly
- this methods for scrolling are working on another screens in this app
- the coordinates are correct
- is not working neither in 1.8 nor in 1.9 appium version

I use native android app (api 23) & VS 2017 & windows 10.

**C# CODE**  
public static void Scroll(this AppiumDriver driver, MoveDirection direction)  
{  
var scrollElement = driver.FindElementByClassName(“android.widget.ScrollView”);  
var windowSize = driver.Manage().Window.Size;  
var upperPoint = new Point((int)(windowSize.Width \* 0.3), (int)(windowSize.Height \* 0.55));  
var middlePoint = new Point((int)(windowSize.Width \* 0.3), (int)(windowSize.Height \* 0.75));

```
            switch (direction)
            {
                case MoveDirection.down:
                    Move(driver, scrollElement, middlePoint, upperPoint);
                    break;

                case MoveDirection.up:
                    Move(driver, scrollElement, upperPoint, middlePoint);
                    break;
            }
        }

        private static void Move(this AppiumDriver<IWebElement> driver, IWebElement elementToMove, Point startMove, Point endMove)
        {
            var action = new TouchAction(driver)
                    .Press(elementToMove, startMove.X, startMove.Y)
                    .Wait(500)
                    .MoveTo(elementToMove, endMove.X, endMove.Y)
                    .Release();

            action.Perform();
        }

```

**APPIUM LOGS - only scrolling fragment**

–\> POST /wd/hub/session/29ecf89f-5d08-42c6-95dc-7ac16f74e4a6/touch/perform  
[HTTP] {“actions”:[{“action”:“press”,“options”:{“element”:“45”,“x”:324,“y”:1332}},{“action”:“wait”,“options”:{“ms”:500}},{“action”:“moveTo”,“options”:{“element”:“45”,“x”:324,“y”:976}},{“action”:“release”}]}  
[debug] [MJSONWP] Calling AppiumDriver.performTouch() with args: [[{“action”:“press”,“options”:{“element”:“45”,“x”:324,“y”:1332}},{“action”:“wait”,“options”:{“ms”:500}},{“action”:“moveTo”,“options”:{“element”:“45”,“x”:324,“y”:976}},{“action”:“release”}],“29ecf89f-5d08-42c6-95dc-7ac16f74e4a6”]  
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“element:getLocation”,“params”:{“elementId”:“45”}}  
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“element:getLocation”,“params”:{“elementId”:“45”}}  
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION  
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: getLocation  
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:{“x”:0,“y”:585}}  
[debug] [AndroidBootstrap] Received command result from bootstrap  
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“element:getSize”,“params”:{“elementId”:“45”}}  
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“element:getSize”,“params”:{“elementId”:“45”}}  
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION  
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: getSize  
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:{“width”:1080,“height”:1007}}  
[debug] [AndroidBootstrap] Received command result from bootstrap  
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“element:getLocation”,“params”:{“elementId”:“45”}}  
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“element:getLocation”,“params”:{“elementId”:“45”}}  
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION  
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: getLocation  
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:{“x”:0,“y”:585}}  
[debug] [AndroidBootstrap] Received command result from bootstrap  
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“element:swipe”,“params”:{“startX”:324,“startY”:1332,“endX”:324,“endY”:976,“steps”:14,“elementId”:“45”}}  
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“element:swipe”,“params”:{“startX”:324,“startY”:1332,“endX”:324,“endY”:976,“steps”:14,“elementId”:“45”}}  
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION  
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: swipe  
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element bounds: [0,585][1080,1592]  
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element bounds: [0,585][1080,1592]  
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Swiping from [x=324.0, y=1917.0] to [x=324.0, y=1561.0] with steps: 14  
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:true}  
[debug] [AndroidBootstrap] Received command result from bootstrap  
[debug] [MJSONWP] Responding to client with driver.performTouch() result: true  
[HTTP] \<-- POST /wd/hub/session/29ecf89f-5d08-42c6-95dc-7ac16f74e4a6/touch/perform 200 504 ms - 76

**My capabilities**

```
        cap.SetCapability(MobileCapabilityType.App, "path");
        cap.SetCapability(MobileCapabilityType.PlatformName, "Android");
        cap.SetCapability(MobileCapabilityType.DeviceName, "device");
        cap.SetCapability(AndroidMobileCapabilityType.AppPackage, PackageName);
        cap.SetCapability(AndroidMobileCapabilityType.NoSign, true);
        cap.SetCapability(MobileCapabilityType.AutomationName, "Appium");
        cap.SetCapability(AndroidMobileCapabilityType.AppWaitActivity, "name.*");
        cap.SetCapability(MobileCapabilityType.NewCommandTimeout, "360");
        cap.SetCapability(AndroidMobileCapabilityType.UnicodeKeyboard, "true");
        cap.SetCapability(AndroidMobileCapabilityType.ResetKeyboard, "true");
        cap.SetCapability("autoGrantPermissions", "true");
```

---

<div class="post-metadata">

**Author:** ![saikrishna321](https://discuss.appium.io/user_avatar/discuss.appium.io/saikrishna321/32/5170_2.png) [@saikrishna321](https://discuss.appium.io/u/saikrishna321)\
**Post date:** [September 28, 2018, 2:14pm UTC](https://discuss.appium.io/t/scrolling-is-not-working-on-nested-scrollview-c-android/23729/2 "2018-09-28T14:14:06Z")

</div>

> [@karolina](#):
>
> cap.SetCapability(MobileCapabilityType.AutomationName, “Appium”);

can you run the test with cap.SetCapability(MobileCapabilityType.AutomationName, “UIAutomator2”);

---

<div class="post-metadata">

**Author:** ![karolina](https://discuss.appium.io/user_avatar/discuss.appium.io/karolina/32/4801_2.png) [@karolina](https://discuss.appium.io/u/karolina)\
**Post date:** [October 1, 2018, 7:31am UTC](https://discuss.appium.io/t/scrolling-is-not-working-on-nested-scrollview-c-android/23729/3 "2018-10-01T07:31:42Z")

</div>

Thanks for reply!  
Unfortunately situation is exactly the same - in logs everythings looks fine but screen just not move

[HTTP] --\> POST /wd/hub/session/1180056b-e369-408a-af8e-3e57a0a47017/touch/perform  
[HTTP] {“actions”:[{“action”:“press”,“options”:{“element”:“0bc3fa90-8391-4af2-884b-185903098226”,“x”:324,“y”:1332}},{“action”:“wait”,“options”:{“ms”:500}},{“action”:“moveTo”,“options”:{“element”:“0bc3fa90-8391-4af2-884b-185903098226”,“x”:324,“y”:976}},{“action”:“release”}]}  
[debug] [MJSONWP] Calling AppiumDriver.performTouch() with args: [[{“action”:“press”,“options”:{“element”:“0bc3fa90-8391-4af2-884b-185903098226”,“x”:324,“y”:1332}},{“action”:“wait”,“options”:{“ms”:500}},{“action”:“moveTo”,“options”:{“element”:“0bc3fa90-8391-4af2-884b-185903098226”,“x”:324,“y”:976}},{“action”:“release”}],“1180056b-e369-408a-af8e-3e57a0a47017”]  
[UiAutomator2] calling get location: 0bc3fa90-8391-4af2-884b-185903098226  
[debug] [JSONWP Proxy] Matched ‘/element/0bc3fa90-8391-4af2-884b-185903098226/location’ to command name ‘getLocation’  
[debug] [JSONWP Proxy] Proxying [GET /element/0bc3fa90-8391-4af2-884b-185903098226/location] to [GET [http://localhost:8200/wd/hub/session/67c86dc2-fa43-4dec-9b5a-96ed39c1f636/element/0bc3fa90-8391-4af2-884b-185903098226/location](http://localhost:8200/wd/hub/session/67c86dc2-fa43-4dec-9b5a-96ed39c1f636/element/0bc3fa90-8391-4af2-884b-185903098226/location)] with body: {}  
[debug] [JSONWP Proxy] Got response with status 200: “{“sessionId”:“67c86dc2-fa43-4dec-9b5a-96ed39c1f636”,“status”:0,“value”:{“x”:0,“y”:585}}”  
[debug] [JSONWP Proxy] Matched ‘/element/0bc3fa90-8391-4af2-884b-185903098226/size’ to command name ‘getSize’  
[debug] [JSONWP Proxy] Proxying [GET /element/0bc3fa90-8391-4af2-884b-185903098226/size] to [GET [http://localhost:8200/wd/hub/session/67c86dc2-fa43-4dec-9b5a-96ed39c1f636/element/0bc3fa90-8391-4af2-884b-185903098226/size](http://localhost:8200/wd/hub/session/67c86dc2-fa43-4dec-9b5a-96ed39c1f636/element/0bc3fa90-8391-4af2-884b-185903098226/size)] with body: {}  
[debug] [JSONWP Proxy] Got response with status 200: “{“sessionId”:“67c86dc2-fa43-4dec-9b5a-96ed39c1f636”,“status”:0,“value”:{“width”:1080,“height”:1007}}”  
[UiAutomator2] calling get location: 0bc3fa90-8391-4af2-884b-185903098226  
[debug] [JSONWP Proxy] Matched ‘/element/0bc3fa90-8391-4af2-884b-185903098226/location’ to command name ‘getLocation’  
[debug] [JSONWP Proxy] Proxying [GET /element/0bc3fa90-8391-4af2-884b-185903098226/location] to [GET [http://localhost:8200/wd/hub/session/67c86dc2-fa43-4dec-9b5a-96ed39c1f636/element/0bc3fa90-8391-4af2-884b-185903098226/location](http://localhost:8200/wd/hub/session/67c86dc2-fa43-4dec-9b5a-96ed39c1f636/element/0bc3fa90-8391-4af2-884b-185903098226/location)] with body: {}  
[debug] [JSONWP Proxy] Got response with status 200: “{“sessionId”:“67c86dc2-fa43-4dec-9b5a-96ed39c1f636”,“status”:0,“value”:{“x”:0,“y”:585}}”  
[debug] [JSONWP Proxy] Matched ‘/touch/perform’ to command name ‘performTouch’  
[debug] [JSONWP Proxy] Proxying [POST /touch/perform] to [POST [http://localhost:8200/wd/hub/session/67c86dc2-fa43-4dec-9b5a-96ed39c1f636/touch/perform](http://localhost:8200/wd/hub/session/67c86dc2-fa43-4dec-9b5a-96ed39c1f636/touch/perform)] with body: {“startX”:324,“startY”:1332,“endX”:324,“endY”:976,“steps”:14,“elementId”:“0bc3fa90-8391-4af2-884b-185903098226”}  
[debug] [JSONWP Proxy] Got response with status 200: {“sessionId”:“67c86dc2-fa43-4dec-9b5a-96ed39c1f636”,“status”:0,“value”:true}  
[debug] [MJSONWP] Responding to client with driver.performTouch() result: true  
[HTTP] \<-- POST /wd/hub/session/1180056b-e369-408a-af8e-3e57a0a47017/touch/perform 200 1159 ms - 76  
[HTTP]

---

<div class="post-metadata">

**Author:** ![mykola-mokhnach](https://discuss.appium.io/user_avatar/discuss.appium.io/mykola-mokhnach/32/4578_2.png) [@mykola-mokhnach](https://discuss.appium.io/u/mykola-mokhnach)\
**Post date:** [October 1, 2018, 8:12am UTC](https://discuss.appium.io/t/scrolling-is-not-working-on-nested-scrollview-c-android/23729/4 "2018-10-01T08:12:40Z")

</div>

Try to provide absolute coordinates instead of relative. There is a known bug, which prevents relative elemnt coordinates from being calculated properly

---

<div class="post-metadata">

**Author:** ![karolina](https://discuss.appium.io/user_avatar/discuss.appium.io/karolina/32/4801_2.png) [@karolina](https://discuss.appium.io/u/karolina)\
**Post date:** [October 2, 2018, 10:15am UTC](https://discuss.appium.io/t/scrolling-is-not-working-on-nested-scrollview-c-android/23729/5 "2018-10-02T10:15:49Z")

</div>

Thanks for reply, it doesn’t help either. Log’s are the same.

---

<div class="post-metadata">

**Author:** ![mykola-mokhnach](https://discuss.appium.io/user_avatar/discuss.appium.io/mykola-mokhnach/32/4578_2.png) [@mykola-mokhnach](https://discuss.appium.io/u/mykola-mokhnach)\
**Post date:** [October 2, 2018, 10:43am UTC](https://discuss.appium.io/t/scrolling-is-not-working-on-nested-scrollview-c-android/23729/6 "2018-10-02T10:43:52Z")

</div>

The log should not be the same after the element option is removed

---

<div class="post-metadata">

**Author:** ![Wafe\_is\_7](https://discuss.appium.io/letter_avatar_proxy/v4/letter/w/e47774/32.png) [@Wafe\_is\_7](https://discuss.appium.io/u/Wafe_is_7)\
**Post date:** [October 2, 2018, 11:10am UTC](https://discuss.appium.io/t/scrolling-is-not-working-on-nested-scrollview-c-android/23729/7 "2018-10-02T11:10:42Z")

</div>

@mykola-mokhnach Hi.

Can you help me with the consultation about scrolling with appium version 1.9.1. please.

Environment:  
robotframework-appiumlibrary==1.4.6  
Appium-Python-Client==0.28  
iOS 12  
Real Device  
Xcode = 10.0  
Appium 1.9.1

The issue is not working scroll. In the appium logs I see the response 200 but on the device, nothing happens.  
Works only swipe by the coordinates, but it`s not good.

See logs: [https://gist.github.com/WaFeIS7/65e49dd4c613adb432214c725bf2bc3a](https://gist.github.com/WaFeIS7/65e49dd4c613adb432214c725bf2bc3a)

If I use appium 1.7.2 for the iOS 11.4, real device, the scroll is working.

if any solutions to scroll with the appium 1.9.1 and iOS 12 real device?

Thanks.

---

<div class="post-metadata">

**Author:** ![sandysandy7](https://discuss.appium.io/letter_avatar_proxy/v4/letter/s/76d3ee/32.png) [@sandysandy7](https://discuss.appium.io/u/sandysandy7)\
**Post date:** [October 2, 2018, 3:17pm UTC](https://discuss.appium.io/t/scrolling-is-not-working-on-nested-scrollview-c-android/23729/8 "2018-10-02T15:17:36Z")

</div>

Hi Wafe\_is\_7,  
Could you able to send or explain how scroll working for you (If I use appium 1.7.2 for the iOS 11.4, real device, the scroll is working).  
I am using appium 1.9.1 for IOS 11.4 real device not working for me.

Thanks

---

<div class="post-metadata">

**Author:** ![Wafe\_is\_7](https://discuss.appium.io/letter_avatar_proxy/v4/letter/w/e47774/32.png) [@Wafe\_is\_7](https://discuss.appium.io/u/Wafe_is_7)\
**Post date:** [October 3, 2018, 6:09am UTC](https://discuss.appium.io/t/scrolling-is-not-working-on-nested-scrollview-c-android/23729/9 "2018-10-03T06:09:49Z")

</div>

Hello, @sandysandy7  
ENV:  
Appium 1.7.2  
iOS 11.4  
Appium-Python-Client==0.28  
robotframework-appiumlibrary==1.4.6  
Xcode = 9.4.1  
This Function inside robotframework-appiumlibrary works correctly

```
    """
    def scroll(self, start_locator, end_locator):
    Scrolls from one element to another
    Key attributes for arbitrary elements are `id` and `name`. See
    `introduction` for details about locating elements.
    """
    el1 = self._element_find(start_locator, True, True)
    el2 = self._element_find(end_locator, True, True)
    driver = self._current_application()
    driver.scroll(el1, el2)  

```

In case if I use:  
ENV:  
Appium 1.9.1  
iOS 12 or 11.4  
Appium-Python-Client==0.28  
robotframework-appiumlibrary==1.4.6  
Xcode = 10

That function scroll doesn’t work as expected, in server appium I see response status of the request 200, but nothing happens on the device.  
That`s why I want to find any solution to fix it.  
And Asked this problem to @mykola-mokhnach

---

<div class="post-metadata">

**Author:** ![mykola-mokhnach](https://discuss.appium.io/user_avatar/discuss.appium.io/mykola-mokhnach/32/4578_2.png) [@mykola-mokhnach](https://discuss.appium.io/u/mykola-mokhnach)\
**Post date:** [October 3, 2018, 8:31am UTC](https://discuss.appium.io/t/scrolling-is-not-working-on-nested-scrollview-c-android/23729/10 "2018-10-03T08:31:36Z")

</div>

> <https://github.com/appium/appium/issues/11181>

---

<div class="post-metadata">

**Author:** ![karolina](https://discuss.appium.io/user_avatar/discuss.appium.io/karolina/32/4801_2.png) [@karolina](https://discuss.appium.io/u/karolina)\
**Post date:** [October 3, 2018, 9:57am UTC](https://discuss.appium.io/t/scrolling-is-not-working-on-nested-scrollview-c-android/23729/11 "2018-10-03T09:57:52Z")

</div>

Sorry, I didn’t get that I should delete element 😉 Thanks! It’s working now.  
Do you know if that bug will be fixed?

---

<div class="post-metadata">

**Author:** ![mykola-mokhnach](https://discuss.appium.io/user_avatar/discuss.appium.io/mykola-mokhnach/32/4578_2.png) [@mykola-mokhnach](https://discuss.appium.io/u/mykola-mokhnach)\
**Post date:** [October 3, 2018, 10:49am UTC](https://discuss.appium.io/t/scrolling-is-not-working-on-nested-scrollview-c-android/23729/12 "2018-10-03T10:49:25Z")

</div>

There is a pending PR with the fix, however other maintainers don’t really like the design of it:

> <https://github.com/appium/appium-android-driver/pull/355>

Feel free to improve it

---

<div class="post-metadata">

**Author:** ![Pavan\_N](https://discuss.appium.io/letter_avatar_proxy/v4/letter/p/58f4c7/32.png) [@Pavan\_N](https://discuss.appium.io/u/Pavan_N)\
**Post date:** [November 9, 2018, 12:11pm UTC](https://discuss.appium.io/t/scrolling-is-not-working-on-nested-scrollview-c-android/23729/13 "2018-11-09T12:11:57Z")

</div>

Can you please share the code that is working .  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![karolina](https://discuss.appium.io/user_avatar/discuss.appium.io/karolina/32/4801_2.png) [@karolina](https://discuss.appium.io/u/karolina)\
**Post date:** [November 9, 2018, 12:52pm UTC](https://discuss.appium.io/t/scrolling-is-not-working-on-nested-scrollview-c-android/23729/14 "2018-11-09T12:52:20Z")

</div>

Sure. 🙂

```
private static void Move(this AppiumDriver<IWebElement> driver, Point startMove, Point endMove)
        {
            var action = new TouchAction(driver)
                    .Press(startMove.X, startMove.Y)
                    .Wait(500)
                    .MoveTo(endMove.X, endMove.Y)
                    .Release();

            action.Perform();
  }
```
