Below is simple snippet of code.
@FindBy(className = "element-to-press")
private WebElement elementToPress;
// some other code
Keys move = Keys.ARROW_DOWN;
gridContainer.sendKeys(move);
In Firefox everything works fine.
In Chrome I've got "org.openqa.selenium.WebDriverException: unknown error: cannot focus element"
error
Safari does not react for sendKeys()
Also I've tried to use another approach:
Keys move = Keys.ARROW_DOWN;
Actions actions = new Actions(driver);
actions.moveToElement(element).click(); // to focus on element
actions.sendKeys(move).perform();
This code fixed Chrome "cannot focus element"
error, but browser still does not react for Keys.ARROW_DOWN/Keys.ARROW_UP/Keys.ARROW_LEFT/Keys.ARROW_RIGHT
events
Safari and Firefox do not react for sendKeys() as well.
I cannot understand what is going on and how I can make my code run for all this browsers.
Environment:
OS X 10.9.5
Latest version of Chrome/Safari/Firefox
Selenium version 2.44.0
UPD:
Update Selenium to version 2.46.
Works for Chrome and Firefox now.
But still have an issue with Safari:org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session.
UPD2:
I have Safari browser extension installed.