简体   繁体   English

Appium IOS SendKey不起作用

[英]Appium IOS SendKey not working

I am using Appium to automate a Hybrid application. 我正在使用Appium自动执行混合应用程序。 Selenium method sendkey is working fine in Android. 硒方法sendkey在Android中工作正常。 However sendkey is not working in IOS. 但是sendkey在IOS中不起作用。 Hence to make it work I am using javascript executor to set value and then fire the change event. 因此,为了使其正常工作,我正在使用javascript executor设置值,然后触发change事件。

This has really brought down my confidence in appium for automating hybrid app. 这确实降低了我对用于自动化混合应用程序的appium的信心。 I would like to know whether there is any way to make 'sendkey' work in IOS. 我想知道在IOS中是否有任何使“ sendkey”工作的方法。 Also is it a common issue. 这也是一个普遍的问题。

WebElement element = driver.findElementByXPath("YOUR X-PATH");
element.click();
element.sendKeys("your input string");

Well for iOS you should set capability "sendKeyStrategy" to "grouped" or "setValue". 对于iOS,您应该将功能“ sendKeyStrategy”设置为“ grouped”或“ setValue”。

Refer http://appium.io/slate/en/v1.3.4/?ruby#ios-only 请参阅http://appium.io/slate/en/v1.3.4/?ruby#ios-only

I assume you are working with iOS simulator, I think on clicking the text field the keyboard failed to display and hence its failing to enter text to the application. 我假设您正在使用iOS模拟器,我认为在单击文本字段时,键盘无法显示,因此无法向应用程序输入文本。 Please check your simulator setting that the trigger simulator keyboard is checked. 请检查您的模拟器设置,确认已选中触发器模拟器键盘。

Hope this fix your issue. 希望这能解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM