Search code examples
iosios7ios-ui-automation

UI Automation, iOS - How to type special characters like "é" or "á"?


I have a problem with typing of special characters into a text field. Usually, I call the function:

UIATarget.localTarget().frontMostApp().typeString("ANYTHING");

But, if there is a character like é to type, it isn´t able to locate it on keyboard. This character can be typed by tapping and holding the e key on the keyboard. Is there another way? Maybe, something like, setting the value of the text field. The text field can be accessed through the index:

UIATarget.localTarget().frontMostApp().mainWindow().searchBars()[0].tap();

Solution

  • UIATarget.localTarget().frontMostApp().mainWindow().searchBars()[0].tap();
    UIATarget.localTarget().frontMostApp().mainWindow().searchBars()[0]
        .setValue("é & á");