Спасибо за совет! А можно немного подробнее про трансформацию, где про это почитать можно? Пока что тап по координатам элемента ничего не дает, видно, не попадаю.
Делаю так:
WebElement element = driver.findElement(By.xpath(AboutMeSelectors.DUE_DATE_INPUT_MOBILE));
int x = element.getLocation().getX() + element.getSize().getWidth()/2;
int y = element.getLocation().getY() + element.getSize().getHeight()/2;
System.out.println(x + " " + y);
Set<String> contextNames = driver.getContextHandles();
driver.context(contextNames.toArray()[0].toString());
System.out.println(driver.getContext()); // для проверки
driver.tap(1, x, y, 300);
Аппиум пишет вполне корректные логи:
info: <-- GET /wd/hub/session/c278f508-57d9-4aa2-b819-6dfa918b023a/context 200 0.855 ms - 84 {"status":0,"value":"NATIVE_APP","sessionId":"c278f508-57d9-4aa2-b819-6dfa918b023a"}
info: --> POST /wd/hub/session/c278f508-57d9-4aa2-b819-6dfa918b023a/touch/perform {“actions”:[{“action”:“press”,“options”:{“x”:254,“y”:146}},{“action”:“wait”,“options”:{“ms”:300}},{“action”:“release”,“options”:{}}]}
info: [debug] Pushing command to appium work queue: [“element:touchDown”,{“x”:254,“y”:146}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“element:touchDown”,“params”:{“x”:254,“y”:146}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: touchDown
info: [debug] [BOOTSTRAP] [debug] Display bounds: [0,0][320,480]
info: [debug] [BOOTSTRAP] [debug] Performing TouchDown using element? false x: 254, y: 146
info: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:true,“status”:0}
info: [debug] Pushing command to appium work queue: [“element:touchUp”,{“x”:254,“y”:146}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“element:touchUp”,“params”:{“x”:254,“y”:146}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: touchUp
info: [debug] [BOOTSTRAP] [debug] Display bounds: [0,0][320,480]
info: [debug] [BOOTSTRAP] [debug] Performing TouchUp using element? false x: 254, y: 146
info: [debug] Responding to client with success: {“status”:0,“value”:true,“sessionId”:“c278f508-57d9-4aa2-b819-6dfa918b023a”}
info: <-- POST /wd/hub/session/c278f508-57d9-4aa2-b819-6dfa918b023a/touch/perform 200 357.618 ms - 76 {“status”:0,“value”:true,“sessionId”:“c278f508-57d9-4aa2-b819-6dfa918b023a”}
info: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:true,“status”:0}
Если прикидывать по координатам экрана - то элемент как раз и располагается в области 254 х 146, на экране 320 х 480. Даже линейкой меряла…
Но пикера как не было, так и нет(