Getting "Not yet implemented" when try to use Swipe method

I am getting following error when try to use SWIPE method during android app testing :

Not yet implemented. Please help us: http://appium.io/get-involved.html 

My code is :

 try{
JavascriptExecutor js = (JavascriptExecutor) driver;
HashMap<String, Integer> swipeObject = new HashMap<String,  Integer>();
swipeObject.put("startX", 10);
swipeObject.put("startY", 50);
swipeObject.put("endX", 100);
swipeObject.put("endY", 231);
swipeObject.put("duration", 1);
js.executeScript("mobile: swipe", swipeObject);
}
catch(Exception e)
{
	Log.info(""+e);
} 

Any solution?

Please try the below command,

driver.swipe(10,50,100,231,100);

This might help you.:slight_smile:

I tried in that way but that is not doing swipe and also not giving an error. :frowning:

Can i know what is the error you are getting??

When I use above , it is not giving any error but also not doing any swaping…

Please check weather the coordinates are correct.

Or else it will show you “unknown server side error…( something like that…)”…

I have set driver like below :

    public static WebDriver driver;
driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub/"), capabilities);

So does that ok? Or I will need to use appium object?

Try using AndroidDriver or AppiumDriver…

Hi,

I have used now Appiumdriver. Now swipe is supporting but it is not swiping. Also not giving any error. :frowning:

Please mention the error shown…

No Error I am getting , Please check attached screen for properties. I am using their bound property for swipe.

My swipe co-ordinates are : driver.swipe(1, 767, 26, 1231, 10);

It is executing without error but not swiping. Also I am trying in emulator , does swipe support only real device?

The co ordinates are wrong!!

U have to swipe along Xaxis so keep the y axis constant…

Try driver.swipe(767,629,5,629);

This might work fine.

Happy Testing:)

Hey Awesome , Can you teach me how you found those co-ordinates? You are awesome man…Its working:)

Well ThankYou,

By taking your example…

If you wanna swipe horizontally keep the y axis constant and take coordinates exactly half (doesnt need to be half)… but need to be constant…(both start y and end y)
similarly take the
1…(x.end co-ordinates-1) as the (start x) and
2…(x.start co-ordinates +1) as (end x)…

TO SWIPE FROM LEFT TO RIGHT… reverse the coordinates…

And to swipe vertically its vice versa

keep X constant Y as mentioned above…

I hope you got it:).

1 Like

Thanks a lot for this nice explanation. I got it.Thanks again…