我正在使用IntelliJ的Appium 1.4.13,java-client-3.3.0.jar,selenium独立服务器2.48.2。Appium iOS驱动程序无法将密钥发送到UIATextField
我想输入一个值给UIATextField,这是一个数字选择器。我读的教程,并建议:
(MobileElement) iosDriver.findElement(By.xpath("//UIATextField")).sendKeys("abcdef");
但这并没有工作:它只是从iOS的
打开本地numberpicker另一个建议是使用的setValue对Java客户端2.2.0:
(MobileElement) iosDriver.findElement(By.xpath("//UIATextField")).setValue("abcdef");
但setValue方法不存在了。
所以我有一个解决方法如下图所示,它的工作原理:
(MobileElement) iosDriver.findElement(By.xpath("//UIATextField")).click;
iosDriver.scrollToExact("abcdef");
//click confirm
我的问题:
- 的setValue和sendKeyEvents不再可用?
- 有没有更好的方法来输入一个值并确认它?
感谢
这是我从Appium检查了,当我运行
(MobileElement) iosDriver.findElement(By.xpath("//UIATextField")).sendKeys("170");
通过检查截图我使用'find'图标,你可以在此操作栏上的用户界面中看到(左四) – nullpointer
@nullpointer意味着版面图:谢谢你为你的时间,我设法使它与setValue一起工作。再次感谢:) – Ragnarsson