# Unable to Scroll the seekbar

**URL:** <https://discuss.appium.io/t/unable-to-scroll-the-seekbar/25037>\
**Category:** Support\
**Created:** [January 29, 2019, 9:47am UTC](https://discuss.appium.io/t/unable-to-scroll-the-seekbar/25037 "2019-01-29T09:47:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AnushaSudheer](https://discuss.appium.io/letter_avatar_proxy/v4/letter/a/bc79bd/32.png) [@AnushaSudheer](https://discuss.appium.io/u/AnushaSudheer)\
**Post date:** [January 29, 2019, 9:47am UTC](https://discuss.appium.io/t/unable-to-scroll-the-seekbar/25037/1 "2019-01-29T09:47:44Z")

</div>

![seekbar](https://discuss.appium.io/uploads/default/original/2X/5/5e6753ad54b7d11f302ff391e210ad72893f9c60.png)

Unable to automate this seekbar feature . I should drag this seekbar to some %. Working on Android device.

HTML for referance:

 ![image](https://discuss.appium.io/uploads/default/original/2X/4/4fddae66d582751ebf5c74a40722e443a65737e3.png)

Please help me to automate this feature. I am using corejava, appium and selenium to write code. Please help me with a code to automate the functionality.

---

<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:** [January 29, 2019, 5:52pm UTC](https://discuss.appium.io/t/unable-to-scroll-the-seekbar/25037/2 "2019-01-29T17:52:34Z")

</div>

I think you need some kind of TouchAction. Take a look at this:

[https://appium.io/docs/en/writing-running-appium/touch-actions/](https://appium.io/docs/en/writing-running-appium/touch-actions/)

---

<div class="post-metadata">

**Author:** ![AnushaSudheer](https://discuss.appium.io/letter_avatar_proxy/v4/letter/a/bc79bd/32.png) [@AnushaSudheer](https://discuss.appium.io/u/AnushaSudheer)\
**Post date:** [January 30, 2019, 3:47am UTC](https://discuss.appium.io/t/unable-to-scroll-the-seekbar/25037/3 "2019-01-30T03:47:37Z")

</div>

Thanks Wreed for your reply. Yes i have tried couple of methods using Touch Actions, but did not work . Below is the code:

public void testSeekbar(){

```
	//Get Start co-ordinate of seek bar
	int start = seek_Bar.getLocation().getX();
	System.out.println(start);
	
	// Get Location of seekbar vertically
	int y = seek_Bar.getLocation().getY();
	System.out.println(y);
	
	// Get Width of Seek Bar
	int end = seek_Bar.getSize().getWidth();
	System.out.println(end);
	
	// Create object of Touch Actions class
	TouchAction action = new TouchAction(driver);
	
	// Move it till end
	
	
	action.longPress(start, y).moveTo(end, y).release().perform();
	//action.press(start, y).moveTo(end, y).release().perform();

```

Second one:

Dimension dim = seekbar16.getSize();  
System.out.println(dim);  
int height = dim.getHeight();  
int width = dim.getWidth();  
int x = width/2;  
int top\_y = (int)(height_0.80);  
int bottom\_y = (int)(height_0.20);  
System.out.println(“coordinates :” + x + " "+ top\_y + " "+ bottom\_y);  
driver.swipe(x, top\_y, x, bottom\_y, 5000);  
TouchAction ts = new TouchAction(driver);  
ts.press(x, top\_y).moveTo(x, bottom\_y).release().perform();

None of them is working for me.

---

<div class="post-metadata">

**Author:** ![Tom\_Cockram](https://discuss.appium.io/letter_avatar_proxy/v4/letter/t/cc9497/32.png) [@Tom\_Cockram](https://discuss.appium.io/u/Tom_Cockram)\
**Post date:** [January 30, 2019, 12:18pm UTC](https://discuss.appium.io/t/unable-to-scroll-the-seekbar/25037/4 "2019-01-30T12:18:42Z")

</div>

I have just done this using this method in the below thread:

> [@How to Handle (drag) Seek bar in Android?](https://discuss.appium.io/t/how-to-handle-drag-seek-bar-in-android/5864/6):
>
> 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 Tou…

Hopefully it works as smoothly for you as it did for me.

---

<div class="post-metadata">

**Author:** ![AnushaSudheer](https://discuss.appium.io/letter_avatar_proxy/v4/letter/a/bc79bd/32.png) [@AnushaSudheer](https://discuss.appium.io/u/AnushaSudheer)\
**Post date:** [January 31, 2019, 4:17am UTC](https://discuss.appium.io/t/unable-to-scroll-the-seekbar/25037/5 "2019-01-31T04:17:16Z")

</div>

I don’t have element id as seekbar, so i am unable to find the element. I have given the html content for seek bar, can u please tell me how to find it with the above html?
