Webdriveragent: Can not input inside alert

Created on 24 Nov 2016  路  6Comments  路  Source: facebookarchive/WebDriverAgent

we need input value inside an alert , the keyboard does show up at the bottom and from source tree , but WDA still complains there is an "obstructing view" and can not find keyboard.

debug] [JSONWP Proxy] Proxying [POST /element] to [POST http://localhost:8100/session/5C578E3A-EF5D-4D7B-90FE-06D2E07FD2F2/element] with body: {"using":"class name","value":"XCUIElementTypeTextField"}
[debug] [JSONWP Proxy] Got response with status 200: {"value":{"ELEMENT":"540007CA-E983-40BA-BE3E-36B9FFCBFE9C","type":"XCUIElementTypeTextField","label":""},"sessionId":"5C578E3A-EF5D-4D7B-90FE-06D2E07FD2F2","status":0}
[debug] [MJSONWP] Responding to client with driver.findElement() result: {"ELEMENT":"540007CA-E983-40BA-BE3E-36B9FFCBFE9C","type":"XCUIElementTypeTextField","label":""}
[HTTP] <-- POST /wd/hub/session/1e6d54f0-f4d8-44d2-8050-f9296d25f76d/element 200 602 ms - 167
[HTTP] --> POST /wd/hub/session/1e6d54f0-f4d8-44d2-8050-f9296d25f76d/element/540007CA-E983-40BA-BE3E-36B9FFCBFE9C/value {"id":"540007CA-E983-40BA-BE3E-36B9FFCBFE9C","value":["2"]}
[debug] [MJSONWP] Calling AppiumDriver.setValue() with args: [["2"],"540007CA-E983-40BA-BE3E-36B9FFCBFE9C","1e6d54f0-f4d8-44d2-8050-f9296d25f76d"]
[debug] [XCUITest] Executing command 'setValue'
[debug] [JSONWP Proxy] Proxying [GET /element/540007CA-E983-40BA-BE3E-36B9FFCBFE9C/attribute/type] to [GET http://localhost:8100/session/5C578E3A-EF5D-4D7B-90FE-06D2E07FD2F2/element/540007CA-E983-40BA-BE3E-36B9FFCBFE9C/attribute/type] with no body
[debug] [JSONWP Proxy] Got response with status 200: "{\n \"value\" : \"XCUIElementTypeTextField\",\n \"sessionId\" : \"5C578E3A-EF5D-4D7B-90FE-06D2E07FD2F2\",\n \"status\" : 0\n}"
[debug] [BaseDriver] Set implicit wait to 0ms
[debug] [BaseDriver] Waiting up to 0 ms for condition
[debug] [JSONWP Proxy] Proxying [POST /element] to [POST http://localhost:8100/session/5C578E3A-EF5D-4D7B-90FE-06D2E07FD2F2/element] with body: {"using":"class name","value":"XCUIElementTypeKeyboard"}
[debug] [JSONWP Proxy] Got response with status 200: {"value":"Alert is obstructing view","sessionId":"5C578E3A-EF5D-4D7B-90FE-06D2E07FD2F2","status":26}
[debug] [XCUITest] No keyboard found. Clicking element to open it.
[debug] [JSONWP Proxy] Proxying [POST /element/540007CA-E983-40BA-BE3E-36B9FFCBFE9C/click] to [POST http://localhost:8100/session/5C578E3A-EF5D-4D7B-90FE-06D2E07FD2F2/element/540007CA-E983-40BA-BE3E-36B9FFCBFE9C/click] with body: {}
[debug] [JSONWP Proxy] Got response with status 200: {"status":0,"id":"540007CA-E983-40BA-BE3E-36B9FFCBFE9C","value":"","sessionId":"5C578E3A-EF5D-4D7B-90FE-06D2E07FD2F2"}
[debug] [BaseDriver] Waiting up to 0 ms for condition
[debug] [JSONWP Proxy] Proxying [POST /element] to [POST http://localhost:8100/session/5C578E3A-EF5D-4D7B-90FE-06D2E07FD2F2/element] with body: {"using":"class name","value":"XCUIElementTypeKeyboard"}
[debug] [JSONWP Proxy] Got response with status 200: {"value":"Alert is obstructing view","sessionId":"5C578E3A-EF5D-4D7B-90FE-06D2E07FD2F2","status":26}

Most helpful comment

Hi. Any movement on this one? Seems to be a lot of people experiencing this issue.

All 6 comments

isElementObstructedByAlertView() need update , so far , I simply return NO always .

Add following into isElementObstructedByAlertView() , make sure keyboard never obstructed by alert .

if (element.elementType == XCUIElementTypeKeyboard) {
return NO;
}

@bearxc Feel free to pop a PR with test case :)

Hi. Any movement on this one? Seems to be a lot of people experiencing this issue.

@ericmedvec, @bearxc I am happy to review a PR if you have one :)

@ericmedvec @bearxc

There was a bug in Appium handler, which is fixed in the recent driver component (check
https://github.com/appium/appium-xcuitest-driver/pull/333)

Please wait for the next Appium release or execute

npm remove -g appium
npm install -g appium --no-shrinkwrap

to try it now.

Was this page helpful?
0 / 5 - 0 ratings