MobileElement Swipe error - cannot find symbol

Below is the function that I’m using to perform swipe action:

public void swipeRight(){
MobileElement xxx = (MobileElement) driver.findElement(By.xpath("//*[resource-id=‘xyz’]"));
xxx.swipe(SwipeElementDirection.RIGHT, 2000);

and I’m getting this error:

cannot find symbol
[javac] xxx.swipe(SwipeElementDirection.RIGHT, 2000);
[javac] ^
[javac] symbol: method swipe(SwipeElementDirection,int)
[javac] location: variable xxx of type MobileElement
[javac] 1 error

Any idea??

I’m using javaclient 3.0.0 and running it on Windows.

HI @Kamal_Girdher,

Please have a try with different time intervals in place of 2000,i had the same error long ago
xxx.swipe(SwipeElementDirection.RIGHT, 200/500/1000);

There is a mistake in your Mobile Element Identification,
MobileElement xxx = (MobileElement) driver.findElement(By.xpath("//[**@***resource-id=‘xyz’]"));//you’d missed @ and can use directly instead of xpath.

Hope this will works!!!