0

I'm using appium with java language for building IOS automation. So after successfully login i will be directed to TAC page. input TAC

The numpad will be automatically displayed and i have the TAC code separately. if we press the numpad one by one then it will be filled to the "o". my question is how to make it? i have tried

Map<String, Object> BackspaceKeyEvent  = new HashMap<String, Object>();
BackspaceKeyEvent.put("key", "8");
getDriver().executeScript("mobile:key:event", BackspaceKeyEvent);

But not working

I just want to system press the number like 1,3,5,2,4,6 at that page

Thank you

1 Answers1

-1

Did You tried to simply input via sendkeys via webDriver.

Locate identifiers for keyboard, or for individual buttons, and locate them and You can do interactions via sendKeys then

eg.

MobileElement element0 = driver.findElement(By.id("num0")));
MobileElement element1 = driver.findElement(By.id("num1")));
MobileElement element2 = driver.findElement(By.id("num2")));

...
MobileElement element9 = driver.findElement(By.id("num1")));

so afterwards just do interactions with elements:

element1.click();
element5.click();
element9.click();
Kovacic
  • 1,473
  • 6
  • 21
  • I don't see why it wouldn't work on iOS, if the ID's is set, or any other identifier, in theory it should work, I'm not familiarised with dom structure, but this is element as any other – Kovacic May 07 '18 at 19:40