-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Succesful element click returns malformed response #654
Comments
I attempted introduce a workaround in WebdriverIO but it was not accepted due to WinAppDriver's behavior being at fault. |
Has any workaround been found for this? We're trying to get a native Windows app automated but without clicks working properly it's a non-starter. |
Same here - really annoying! @timotiusmargo @yodurr - any ideas? |
I've been trying to find a workaround on this, and wonder if the stale element error is the culprit here. In fact, I cannot seem to find a way to pull up an element by ID using any of the Here's a minimal demo script that I'm running written in TypeScript: import WebDriver from 'webdriver'
async function demo() {
const capabilities = {
platformName: 'Windows',
platformVersion: '10.0',
app: 'my-app-name.exe',
appWorkingDir: 'path/to/my-app'
}
const session = await WebDriver.newSession({
port: 4723,
path: '',
capabilities
})
const element = await session.findElement('xpath', '//*')
// @ts-ignore
const elementId = element.ELEMENT
console.log(elementId) // This is fine, confirms that an element was found
await session.elementClick(elementId) // This throws an error
}
demo() The |
I don't think the problem is in Stale Element. The reason why WDIO throws an error is that WDIO expects 'value' property in every reply from WinAppDriver. However, when running commands like "click", WinAppDriver just returns "status: 0" reply, with no "value" property. I guess other drivers just ignore that fact and return success status. But WDIO claims that this is not compatible with W3C certificate, thus throwing an error. I think Microsoft must fix WinAppDriver to include "value" properly or even release WAD as an open-source, so the community can help to fix such issues. But in meantime, I am going to submit a PR to Appium project, as "value" property can be added on Appium level, whenever the underlying driver doesn't return it in the response body. Stay tuned... |
WinAppDriver needs to include value key on the response object even when value is NULL ( e.g. return obj for actions like click). #740 |
@hassanuz @timotiusmargo Is there any plan for fixing this issue ? This seems like a complete stopper for so many projects who want to use wdio-winappdriver. Getting this fixed would be greatly appreciated by entire test community who want to use wdio. Is there any work around for this issue, until this gets fixed for real , it would really help. |
@hassanuz @timotiusmargo Is there any plan on fixing this? We have a test framework setup with webdriverIO which we would want to re-use for winapp UWP app. Any update on plans would be really appreciated! |
Using WebdriverIO and Appium I'm able to click on an element successfully, e.g. a button in Calculator, but the response does not contain the expected NULL value. This results in WebdriverIO interpreting the click as failed.
According to the WC3 spec the click should "Return success with data null. " WinAppDriver is returning success, but is failing to return an explicit value of NULL.
https://w3c.github.io/webdriver/#element-click
An issue has been filed for WebdriverIO but I believe the issue is due to WinAppDriver.
webdriverio/webdriverio#2775 (comment)
This WebdriverIO sample recreates the error
This is the Appium output that illustrates the missing NULL value. The currently returned response is:
[debug] [WD Proxy] Got response with status 200: {"sessionId":"60D8F800-BEE0-42FF-B8DF-EA120FEAF7CD","status":0}
More complete output below
The text was updated successfully, but these errors were encountered: