Hold down and creating market on the map

We have a map display application and I need to hold down on the map to make a marker. I am using click() and it does not seem to work.
Any ideas?

Thank you!

Please check TouchAction:


You have longpress(…) method that will help you

Thank you.

This is my code and it’s stuck at last line. It is suppose to press buttonsighting, last line the text box comes up then long press on the map to make marker then enter “test” in the text box… Not sure what I am doing wrong here.

	TouchAction action = new TouchAction(null);
	WebElement webElement = null;

?? null. Shouldn’t it be your driver like:

TouchAction touchAction=new TouchAction(driver);


So I fixed it but still no marker, thanks:

TouchAction action = new TouchAction(driver);
WebElement webElement = (WebElement) driver;

your webElement is also null.

WebElement element=driver.findElement(By.id("element_id"));
TouchAction touchAction=new TouchAction(driver);

if it doesn’t work, maybe give a duration in ms:


My goodness, it worked!!! Thank you so much!
I am new to Appium as well as Java… Trying to learn…

Thank you again!