facebookarchive / WebDriverAgent

A WebDriver server for iOS that runs inside the Simulator.
Other
4.15k stars 1.36k forks source link

Sendkeys does not send all the keys (XCUITest - iOS) #1036

Open prakashpqa opened 5 years ago

prakashpqa commented 5 years ago

Sendkeys is not sending the all the keys to the device on iOS (iPAD):

When I am using the below method to send the characters, it types it as "ACDEFG" or "BCDEFG", etc. One of the characters will always be missing.

element.sendkeys("ABCDEFG")

I tried all the below send key strategy with delay. But it's not working as expected.

ioscap.setCapability(IOSMobileCapabilityType.INTER_KEY_DELAY, Integer.valueOf(iOSConfigData.get("INTER_KEY_DELAY")));
ioscap.setCapability(IOSMobileCapabilityType.SEND_KEY_STRATEGY, iOSConfigData.get("SEND_KEY_STRATEGY"));
2018-11-27 15:57:03:266 - [debug] [JSONWP Proxy] Matched '/element/1E000000-0000-0000-B00A-000000000000/value' to command name 'setValue'
2018-11-27 15:57:03:266 - [debug] [JSONWP Proxy] Proxying [POST /element/1E000000-0000-0000-B00A-000000000000/value] to [POST http://localhost:8100/session/0DFDAB38-2909-4D3C-AB87-F5493252D239/element/1E000000-0000-0000-B00A-000000000000/value] with body: {"value":["x","x","x","x","x","x","x","x","x","1","2","3"]}
2018-11-27 15:57:03:279 - [iOSLog] [IOS_SYSLOG_ROW] Nov 27 23:57:03 GTO testmanagerd[2729] <Notice>: <private>
2018-11-27 15:57:03:279 - [iOSLog] [IOS_SYSLOG_ROW] Nov 27 23:57:03 GTO testmanagerd[2729] <Notice>: <private>
2018-11-27 15:57:03:280 - [iOSLog] [IOS_SYSLOG_ROW] Nov 27 23:57:03 GTO testmanagerd[2729] <Notice>: <private>
2018-11-27 15:57:03:280 - [iOSLog] [IOS_SYSLOG_ROW] Nov 27 23:57:03 GTO testmanagerd[2729] <Notice>: <private>
2018-11-27 15:57:03:280 - [iOSLog] [IOS_SYSLOG_ROW] Nov 27 23:57:03 GTO testmanagerd[2729] <Notice>: <private>
2018-11-27 15:57:03:280 - [iOSLog] [IOS_SYSLOG_ROW] Nov 27 23:57:03 GTO testmanagerd[2729] <Notice>: <private>
2018-11-27 15:57:03:280 - [iOSLog] [IOS_SYSLOG_ROW] Nov 27 23:57:03 GTO testmanagerd[2729] <Notice>: <private>
2018-11-27 15:57:03:281 - [iOSLog] [IOS_SYSLOG_ROW] Nov 27 23:57:03 GTO testmanagerd[2729] <Notice>: <private>
2018-11-27 15:57:03:281 - [iOSLog] [IOS_SYSLOG_ROW] Nov 27 23:57:03 GTO salesApp(UIAccessibility)[2736] <Error>: This child can't be serialized correctly: <AXUIElement 0x1702b1f40> {pid=2736}
2018-11-27 15:57:03:282 - [iOSLog] [IOS_SYSLOG_ROW] Nov 27 23:57:03 GTO salesApp(UIAccessibility)[2736] <Error>: This child can't be serialized correctly: <AXUIElement 0x1742b6860> {pid=2736}
2018-11-27 15:57:03:283 - [iOSLog] [IOS_SYSLOG_ROW] Nov 27 23:57:03 GTO salesApp(UIAccessibility)[2736] <Error>: This child can't be serialized correctly: <AXUIElement 0x1742b6860> {pid=2736}
2018-11-27 15:57:03:284 - [iOSLog] [IOS_SYSLOG_ROW] Nov 27 23:57:03 GTO salesApp(UIAccessibility)[2736] <Error>: This child can't be serialized correctly: <AXUIElement 0x1742b6860> {pid=2736}
2018-11-27 15:57:03:285 - [iOSLog] [IOS_SYSLOG_ROW] Nov 27 23:57:03 GTO salesApp(UIAccessibility)[2736] <Error>: This child can't be serialized correctly: <AXUIElement 0x1742b6860> {pid=2736}
2018-11-27 15:57:03:285 - [iOSLog] [IOS_SYSLOG_ROW] Nov 27 23:57:03 GTO salesApp(UIAccessibility)[2736] <Error>: This child can't be serialized correctly: <AXUIElement 0x1742b6860> {pid=2736}
2018-11-27 15:57:03:286 - [iOSLog] [IOS_SYSLOG_ROW] Nov 27 23:57:03 GTO salesApp(UIAccessibility)[2736] <Error>: This child can't be serialized correctly: <AXUIElement 0x1742b6860> {pid=2736}
2018-11-27 15:57:03:287 - [iOSLog] [IOS_SYSLOG_ROW] Nov 27 23:57:03 GTO salesApp(UIAccessibility)[2736] <Error>: This child can't be serialized correctly: <AXUIElement 0x1742b6860> {pid=2736}
2018-11-27 15:57:03:287 - [iOSLog] [IOS_SYSLOG_ROW] Nov 27 23:57:03 GTO salesApp(UIAccessibility)[2736] <Error>: This child can't be serialized correctly: <AXUIElement 0x1742b6860> {pid=2736}
2018-11-27 15:57:03:288 - [iOSLog] [IOS_SYSLOG_ROW] Nov 27 23:57:03 GTO salesApp(UIAccessibility)[2736] <Error>: This child can't be serialized correctly: <AXUIElement 0x1742b6860> {pid=2736}
2018-11-27 15:57:03:289 - [iOSLog] [IOS_SYSLOG_ROW] Nov 27 23:57:03 GTO salesApp(UIAccessibility)[2736] <Error>: This child can't be serialized correctly: <AXUIElement 0x1742b6860> {pid=2736}
2018-11-27 15:57:03:289 - [iOSLog] [IOS_SYSLOG_ROW] Nov 27 23:57:03 GTO salesApp(UIAccessibility)[2736] <Error>: This child can't be serialized correctly: <AXUIElement 0x1742b6860> {pid=2736}
2018-11-27 15:57:03:290 - [iOSLog] [IOS_SYSLOG_ROW] Nov 27 23:57:03 GTO salesApp(UIAccessibility)[2736] <Error>: This child can't be serialized correctly: <AXUIElement 0x1702b3380> {pid=2736}
2018-11-27 15:57:03:290 - [iOSLog] [IOS_SYSLOG_ROW] Nov 27 23:57:03 GTO salesApp(UIAccessibility)[2736] <Error>: This child can't be serialized correctly: <AXUIElement 0x1702b3380> {pid=2736}
2018-11-27 15:57:03:291 - [iOSLog] [IOS_SYSLOG_ROW] Nov 27 23:57:03 GTO salesApp(UIAccessibility)[2736] <Error>: This child can't be serialized correctly: <AXUIElement 0x1702b3380> {pid=2736}
2018-11-27 15:57:03:291 - [iOSLog] [IOS_SYSLOG_ROW] Nov 27 23:57:03 GTO salesApp(UIAccessibility)[2736] <Error>: This child can't be serialized correctly: <AXUIElement 0x1702b3380> {pid=2736}

These are my app versions:

Appium CLI: 1.9.1 
WebDriverAgent: The same that came with Appium CLI. 
MacOS: 10.14.1 
iOS version: 10.3.3 
Device: iPad 
Driver: XCUITest (WebDriverAgent) 
fdPoornima commented 5 years ago

I am also facing the same problem Appium Version : v1.13.0-beta.1 IOS version : 11.0 MACOS :10.14.4 Device : iPhone 6 plus Automation name : XCUITest

I am automating a native page from a hybrid IOS application. For the test, I have to enter an amount "0.05" to one of the native fields, for which I am using sendkeys. The issue now is that randomly, certain keys gets missed and the script ends up entering wrong amounts to the field like "005" etc . Could you please advice?