I have tried but getting error.
Dimension size = driver.manage().window().getSize();
System.out.println(size);
int startx = (int) (size.width * 0.70);
int endx = (int) (size.width * 0.30);
int starty = size.height / 2;
ts.press(startx,starty).moveTo(endx,starty).release().perform();
or
ts.press(endx,starty).moveTo(startx,starty).release().perform();
Error:
Exception in thread “main” org.openqa.selenium.interactions.InvalidCoordinatesException: The coordinates provided to an interactions operation are invalid. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds