# Swipe is working for android app but not for android browser

**URL:** <https://club.ministryoftesting.com/t/swipe-is-working-for-android-app-but-not-for-android-browser/39817>\
**Category:** Archive\
**Tags:** mobile-testing\
**Created:** [18 June 2020 12:04 UTC](https://club.ministryoftesting.com/t/swipe-is-working-for-android-app-but-not-for-android-browser/39817 "2020-06-18T12:04:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yashi\_r](https://avatars.discourse-cdn.com/v4/letter/y/ec9cab/32.png) [@yashi\_r](https://club.ministryoftesting.com/u/yashi_r)\
**Post date:** [18 June 2020 12:04 UTC](https://club.ministryoftesting.com/t/swipe-is-working-for-android-app-but-not-for-android-browser/39817/1 "2020-06-18T12:04:52Z")

</div>

Hi,

I am testing mobile browser website. I want to swipe by coordinates how I have done for apps:

driver.swipe(x1,y1, x1, y2, 400)

Above code is working properly in android apps but when same code I am using in android browser testing then it is showing below error message:

AttributeError: ‘WebDriver’ object has no attribute ‘swipe’.

I have tried few things:

ta = TouchAction(driver)  
ta.tap(x=100, y=200).wait(100).move\_to(x=100, y=80).wait(100).release()

context.driver.execute\_script(“mobile: scroll”, {“direction”: “down”})

action = TouchAction(driver)  
action.long\_press(element).wait\_action(3000).move\_to(x=100, y=80).perform().release()

but nothing is working from above tried codes.

**actions = ActionChains(driver)**  
**actions.move\_to\_element(element)**  
**actions.perform()**

Above code works for android browser but only for those elements which are loaded. But in my case page is not loaded completely. If I will go to the end of page then other elements will starts to load. So I can go to the end of page by using “move\_to\_element” code, but after that I want to do manual swipe so that other half of the page will also starts loading.

Can anyone help me for coordinate based swipe work around.

Appium Version : 1.17.1  
Android emulator version : 8.0 (Oreo)  
chrome version : 83

Thanks

---

<div class="post-metadata">

**Author:** ![pr4bh4sh](https://avatars.discourse-cdn.com/v4/letter/p/ee7513/32.png) [@pr4bh4sh](https://club.ministryoftesting.com/u/pr4bh4sh)\
**Post date:** [24 June 2020 14:15 UTC](https://club.ministryoftesting.com/t/swipe-is-working-for-android-app-but-not-for-android-browser/39817/2 "2020-06-24T14:15:52Z")

</div>

`WebDriver` doesn’t have implementation for `swipe`, it was implemented for `AndroidDriver` but it has been deprecated. Touch actions are executed in the Native context, so it should have worked.

@yashi_r Try scrolling with adb command

```auto
driver.execute_script('mobile: shell', {'command': 'input swipe', 'args': [x1, y1, x1, y2, duration]})

```

[https://appium.readthedocs.io/en/latest/en/writing-running-appium/android/android-shell/](https://appium.readthedocs.io/en/latest/en/writing-running-appium/android/android-shell/)

---

<div class="post-metadata">

**Author:** ![yashi\_r](https://avatars.discourse-cdn.com/v4/letter/y/ec9cab/32.png) [@yashi\_r](https://club.ministryoftesting.com/u/yashi_r)\
**Post date:** [25 June 2020 11:06 UTC](https://club.ministryoftesting.com/t/swipe-is-working-for-android-app-but-not-for-android-browser/39817/3 "2020-06-25T11:06:37Z")

</div>

Hi @pr4bh4sh,

Thank you so much. I tried your code and it is working.

Thank you for the help.
