MobileElement element1 = idriver.findElementByAccessibilityId(“Element1”);
MobileElement element2 = idriver.findElementByClassName(“XCUIElementTypeTable”).findElementByXPath("//XCUIElementTypeStaticText[@name=“Element2”]");
If i use below code it says error "The application under test with bundle id ‘com.ABC.ABC’ is not running, possibly crashed"
TouchAction touchAction = new TouchAction(idriver);
touchAction.longPress(LongPressOptions. longPressOptions ().withElement(ElementOption. element (element1))).perform()
.moveTo(ElementOption. element ((WebElement) element2)).release().perform();
If i remove perform(), after 1st element from above code, it scrolls screen instead of long press on element.
touchAction.longPress(LongPressOptions. longPressOptions ().withElement(ElementOption. element (element1)))
.moveTo(ElementOption. element ((WebElement) element2)).release().perform();
During manual step execution process a new cell position of ‘XCUIElementTypeCell’ is generated under the element2 location and i need to drop element1 under this new cell, but this new cell position is generated at run time and it’s not a part of element2 as child element. thus i am unable to detect it as of now.
Also using above code i am not able to long press and drag element to element2 location.
I am also not able to drag and drop using exact coordinates.
*Dimension windowSize = idriver.manage().window().getSize();
int startX = 200;
int startY = 250;
int endX = 200;
int endY = 400;
Point start = new Point(startX, startY);
Point end = new Point(endX, endY);
touchAction.press(PointOption.point(startX, startY))
.perform()
.moveTo(PointOption.point(endX, endY))
.release().perform();
@Aleksei can you please look into this.
Here i am adding appium logs also for reference.
Thanks in Advance.