10 tips and tricks in usage of Appium with iOS

I’m sure that almost each of engineers who use Appium had the moments when need to google for some information. And I found that most of the cases that are googled are almost similar for every engineers.
Here is collected the list of tips and tricks how to solve some issue during automation of mobile iOS app with Appium.

Here is collected the list of tips and tricks how to solve some issue during automation of mobile iOS app with Appium.

  • Hide keyboard. It’s a simple method that easy work for Android but not so easy for iOS. So, the ways how to hide keyboard for iOS devices:

self.driver.hide_keyboard(‘return’) – for iPhone will simulate the clicking on Return button. But sometimes this method is not hiding the keyboard but just switching to another text fields.

– Also for iPhone possible to simulate quick swipe from the middle of the screen to the bottom. I will close keyboard. This method work for 95% of cases.

– For iPad need to tap by coordinates on the bottom right side of the screen (minus 30 pixels for height and width).

  • How to send some keys without using of the known methods like set_value or send_keys using UI Automation calls? You need to click on the TextField to open a keyboard and then execute:

self.driver.execute_script(‘var vKeyboard = target.frontMostApp().keyboard();vKeyboard.setInterKeyDelay(0.1);vKeyboard.typeString(“some string”);’)

  • How to set the date in the PickerWheel. You don’t need to swipe nothing. Just take the location of the correct PickerWheel and perform the method send_keys(‘value’) to this Picker element. After setting the date to this element – question: how to close it? Just click somewhere on the screen (not on the Picker).

The full article is here.

2 Likes