# How to Handle (drag) Seek bar in Android?

**URL:** <https://discuss.appium.io/t/how-to-handle-drag-seek-bar-in-android/5864>\
**Category:** Support\
**Created:** [September 4, 2015, 12:49pm UTC](https://discuss.appium.io/t/how-to-handle-drag-seek-bar-in-android/5864 "2015-09-04T12:49:27Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![anujabhatt1](https://discuss.appium.io/user_avatar/discuss.appium.io/anujabhatt1/32/1734_2.png) [@anujabhatt1](https://discuss.appium.io/u/anujabhatt1)\
**Post date:** [February 12, 2016, 7:24am UTC](https://discuss.appium.io/t/how-to-handle-drag-seek-bar-in-android/5864/6 "2016-02-12T07:24:39Z")

</div>

Hi,

These is easy way to use seekbar to move upto some specific postion with below code  
//Locating seekbar using resource id  
WebElement seek\_bar=driver.findElement(By.id(“seek\_bar”));  
// get start co-ordinate of seekbar  
int start=seek\_bar.getLocation().getX();  
//Get width of seekbar  
int end=seek\_bar.getSize().getWidth();  
//get location of seekbar vertically  
int y=seek\_bar.getLocation().getY();

```
    // Select till which position you want to move the seekbar
    TouchAction action=new TouchAction(driver);

   
    //Move it 40%
    int moveTo=(int)(end*0.4);
    action.press(start,y).moveTo(moveTo,y).release().perform();

```

For complete explaination visit my blog -  
[http://qaautomated.blogspot.in/2016/02/how-to-move-seek-bar-with-appium.html](http://qaautomated.blogspot.in/2016/02/how-to-move-seek-bar-with-appium.html)

---

_[View the full topic](https://discuss.appium.io/t/how-to-handle-drag-seek-bar-in-android/5864)._
