简体   繁体   中英

Appium IOS SendKey not working

I am using Appium to automate a Hybrid application. Selenium method sendkey is working fine in Android. However sendkey is not working in IOS. Hence to make it work I am using javascript executor to set value and then fire the change event.

This has really brought down my confidence in appium for automating hybrid app. I would like to know whether there is any way to make 'sendkey' work in IOS. 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".

Refer 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. Please check your simulator setting that the trigger simulator keyboard is checked.

Hope this fix your issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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