How can i send enter key in Appium for Automation testing for iOS

Viewed 30

i have a problem. I'm trying to write an automation test case and this case includes sending enter key.

'''
 public void enterSearchTextInput(String searchText) {
    mobileDriverProvider.getDriver().findElement(MobileBy.id(screenAction
        .waitMobileId("searchTextInputEditText"))).sendKeys(searchText);
      mobileDriverProvider.getDriver().getKeyboard().sendKeys(Keys.ENTER);
  }
'''

This code block runs for android but when i try to same for iOS, it doesn't work. Anyone knows how can i write this for iOS?

Note: I changed MobileBy.id to MobileBy.AccessibilityId for iOS.

0 Answers
Related