Hi! My name is Mathieu, I’m a quality analyst currently working on setting up an automated testing suite for my employer’s proprietary software. I’ve little experience in desktop automation, most of my past experience has been with robot framework for cloud, browser applications.
I’ve been setting up and using Appium for the past few months and up to now, have managed pretty well to do basic operations, like clicking around our app and entering text. However, two functions I’ve been entirely unable to perform: Double clicking, and drag and drop.
For clicking and entering text, I’m using By2.nativeName().click() and .sendKeys(). By2 doesn’t seem to have methods natively for double clicking or drag and drop, but Actions seemed to have it, so I’ve been trying to use Actions, with code looking like this:
const actions = driver.actions({async: false}); (note: I’ve used async: true as well)
actions.press();
actions.move({ x: -500, y: 0, duration: 1000, origin: By2.nativeXpath(‘//Pane/Group/Group/Group/Group/Group/Group[5]/Group/Group[2]’) });
actions.release();
actions.perform();
Or I’ve tried this one for drag and drop too:
actions.dragAndDrop(By2.nativeXpath(‘//Pane/Group/Group/Group/Group/Group/Group[5]/Group/Group[2]’), {x: -750, y: -100})
Unfortunately, I’m met with the following error:
UnsupportedOperationError: Currently only pen and touch pointer input source types are supported
I did find this issue on github that seem to discuss this and this would be an issue on the Microsoft side of things due to mouse pointers not being supported, which is fair. However, clicking works with By2, so perhaps there’s a solution that doesn’t use Actions? Using the click method twice doesn’t seem to work, either.
I’m assuming there’s gotta be a way to get a drag and drop or a double click working, right? It seems like a pretty vital thing to get going on most apps, especially double clicking. How have people been able to get it working, historically? I’m not hard tied to Typescript, but my personal programming experience is only an hobbyist’s on Javascript, so even Typescript is a bit complex to me, so I was hoping to stay on it.
In short, I’m hoping to find a way to get double clicking and drag and drop working on Windows and Mac. My current setup uses WinAppDriver through Appium with tests written in Typescript. I’m hoping for any and all advice.
Thanks in advance for the help
Edit: Just realized I should probably send my dev dependencies
“devDependencies”: {
“@babel/core”: “^7.24.1”,
“@babel/preset-env”: “^7.24.1”,
“@babel/preset-typescript”: “^7.24.1”,
“@types/jest”: “^29.5.12”,
“@types/selenium-webdriver”: “^4.1.22”,
“babel-jest”: “^29.7.0”,
“jest”: “^29.7.0”,
“jest-junit-reporter”: “1.1.0”,
“selenium-appium”: “^1.0.2”,
“selenium-webdriver”: “^4.18.1”,
“typescript”: “^5.4.2”,
“wdio-ywinappdriver-service”: “^0.2.54”,
“winappdriver”: “^0.0.7”
}