Hi @Telmo_Cardoso, i tried this code for Swipe Up, After running, the TestNG test result indicates passed but on the actual device is not swiped. Please Help me. Thanks
One more thing, you can enable touch and pointer option for observing touch action, From android mobile Settings > Developer option > Input > Enable Pointer location and Show touches, observe the touch action and change the start point / end point / time duration from swipeVertical(driver,0.9,0.1,0.5,3000); as you need.
with Regards to Settings, I don’t have also the 'Enable Pointer location and Show touches ’ option. I’m currently using Samsung Galaxy S8. Thank you. @Al_Imran
Method is ok, Please check again, Settings > Enable the Developer options > Scroll down the page > Input > Enable Pointer location and Show touches (check mark box)
I have tried this but no effect takes place
I have 1 question how u get the co-ordinates
0.9,0.1,0.5,3000
And also when I tried this
Dimension dim= SwipeHomeButton.getSize();
int height= dim.getHeight();
int width = dim.getWidth();
int y = (int)(height*.20);
int startx=(int)(width*.75);
int endx=(int)(width*.35);
driver.swipe(startx, y, endx, y,500);
new TouchAction(driver).press(y, startx).waitAction(5000).moveTo(y, endx).release().perform();
It pulled from the top on my android phone
It looks like it is not able to get the proper co-ordinates
I am new to Appium and struggling on calling a swipe method from left to right.
As per you video, driver is not having method called swipe in its intelligence.
I have tried using calling TouchAction class as well but while giving driver as argument it is
throwing the below error all the time. I am Struck and not able to move further.
Hi After using the below method, console show script pass successfully but execution was not happening from left to right for a specific element. please help where am i missing.
public class ExampleHorizontalSwipe {
AndroidDriver driver = null;
}
TouchAction act = new TouchAction(driver);
act.longPress(200, 180, Duration.ofSeconds(2)).moveTo(600, 180).release().perform();