Handling quick action menu

Hi there,

My question is regarding handling floating quick actions menu , which is appear by long press on contact person in contact menu.

Menu look like this :

I’ve tried few approaches , but in all cases it doesn’t work

Example

	TouchAction action = new TouchAction(driver);
	action.longPress(driver.findElement(By.name("Detailed User")));
	action.moveTo(driver.findElementByAccessibilityId(text));
	action.release();
	action.perform();

“text” in this case is Accessibility label for on of the options. Code goes in infinite loop because appuim tries evaluate moveTo item before performing action .

Example 2

	TouchAction press = new TouchAction(driver);
	press.longPress(driver.findElement(By.name("Detailed User")));
	TouchAction move = new TouchAction(driver);
	move.moveTo(driver.findElementByAccessibilityId(text));
	MultiTouchAction action = new MultiTouchAction(driver);
	action.add(press);
	action.add(move);
	action.perform();

This one is also did not worked. Also stuck on evaluation of driver.findElementByAccessibilityId(text).

Example 3

	TouchAction press = new TouchAction(driver);
	press.longPress(driver.findElement(By.name("Detailed User")));
	press.waitAction(10000);
	press.perform();
	TouchAction move = new TouchAction(driver);
	move.moveTo(driver.findElementByAccessibilityId(text));
	move.perform();

This one is just performing press , waits for 10s closes menu after tries to find action element.

Any suggestions ?

I think you should first perform the long press and then try to find the element for accessibility text. Try it.

Before executing action appium tries evaluate all elements participating in action, and it can’t find quick action element because it is drawn after long press.

You can still use moveTo(int x, int y)
x and y will be relative to the location of the long press.
It will be complicated to handle multiple screen sizes, through.