Seekbar / slider issues

Hello appium community.

So the app im testing has a seekbar that you can drag to the left, once you drag enough a value changes. So I basically I wanna try drag the slider to the left until a value changes.

Now my problem:
Every test I’ve done I get “org.openqa.selenium.remote.RemoteWebDriver cannot be cast to org.openqa.selenium.interactions.HasTouchScreen” error.

I’ve tried
import org.openqa.selenium.interactions.touch.TouchActions;
import io.appium.java_client.TouchAction;

When I use the io.appium.java_client.TouchAction; it complains my “new TouchAction(driver)” isn’t using MobileDriver type. Am I supposed to use MobileDriver? Feels odd since Im using WebDriver every other place in my tes, what am I missing?

Example code of my latest try to drag the slider to the left
int xAxisStartPoint = Slider.getLocation().getX() +Slider.getSize().getWidth();
int yAxis = Slider.getLocation().getY()+Slider.getSize().getHeight();
new TouchActions(driver).down(xAxisStartPoint, yAxis).move(150, 0).perform();

This code results with me getting the "cannot be cast to org.openqa.selenium.interactions.HasTouchScreen error.

Appreciate all help. Cheers
Edit, android, java,

1 - Android/iOS ?
2 - Appium 1.6.3 ?
3 - java client 5.0.0-beta?

Example with Android:

new TouchAction((AndroidDriver) driver).press(element).waitAction(2000).moveTo(x,y).release().perform();

Hi,
// Click on Seek Bar.
driver.findElement(By.name(“Seek Bar”)).click();

//Locate SeekBar element.
WebElement seekBar=driver.findElementById(“io.appium.android.apis:id/seek”);
//Get start point of seekbar.
int startX = seekBar.getLocation().getX();

//Get end point of seekbar.
int endX = seekBar.getSize().getWidth();

//Get vertical location of seekbar.
int yAxis = seekBar.getLocation().getY();

//Set sllebar move to position.
//endX * 0.6 means at 60% of seek bar width.
int moveToXDirectionAt = (int) (endX * 0.6);

//Moving seekbar using TouchAction class.
TouchAction act=new TouchAction(driver);
act.press(startX,yAxis).moveTo(moveToXDirectionAt,yAxis).release().perform();