Hello,
hopefully someone can help with this problem. Sometimes the driver.hideKeyboard method crashes, I just thought: “ I could catch the exception and I thought I would be fine” (the keyboard is actually dismissed despite the crash).
Instead in some cases (difficult for me to understand when, it seems pretty random) when I get the exception
the keyboard is indeed hidden, but tapping on a button after that fails (“cannot find the element”).
Seems like the driver is trying to click the button on a “higher” coordinate, missing it, as if it thought the keyboard is still shown.
So I tried something like this:
try {
driver.hideKeyboard();
} catch (WebDriverException e) {
log("\n***** Could not hide the keyboard *****\n%s\n\n", e.getMessage());
// Wait for 2 second and force a screen refresh
waitFor(2);
driver.getPageSource(); //force recalculation of the position of the elements in the view?
}
but still no luck. Any suggestion would be much appreciated.
Cheers,
Manuele