So I have been trying to resolve this for several hours. I have no clue what I am doing wrong.
This is a type ahead field I am looking in is <input type="text" id="id_attendees" name="attendees">
. When I type in there a js dropdown is created. When I press the Down Arrow on keyboard it works fine and selects the top choice. When I do keyDown --- id=id_attendees --- \40
in IDE it works fine and also selects the choice.
I cannot get it to do the same in Java webdriver though
Actions actionObject = new Actions(driver);
actionObject.sendKeys(Keys.ARROW_DOWN);
^doesn't work.
driver.findElement(By.id("id_attendees")).sendKeys(Keys.ARROW_DOWN);
^doesn't work
I tried Keys.DOWN in both cases, that doesn't work either. I created a literal String altm = "\u0040";
and all that does is type an @
symbol.
I also tried a bunch of other things as well and nothing is working. I have no clue what am I missing.
EDIT 1:
@Roddy Thank you! - Given that link I added the following that did work (after importing DefaultSelenium and WebDriverBackedSelenium.
DefaultSelenium sel = new WebDriverBackedSelenium(driver,vars.siteurl);
sel.fireEvent("//input[@id='id_attendees']", "keydown");
EDIT 2: --> DOH that doesn't work. I got overzealous apparently.