Skip to main content
4 of 4
improved formatting of embedded code by using tabs and language hint

How to send down arrow keys for a drop down?

selenium.getDriver().findElement(By.id("s2id_customFilter")).sendKeys(Keys.ARROW_DOWN);

Am using the above code but it's not working."s2id_customFilter" is the id of the drop down.Am clicking on the id and sending keys but there's no action from selenium.

My code:

jQueryWebElement filterElement = selenium.jQuery("#s2id_customFilter");
selenium.jQuery(".select2-choice",filterElement).click();
JOptionPane.showMessageDialog(null, "one");
selenium.getDriver().findElement(By.id("s2id_customFilter")).sendKeys(Keys.ARROW‌​_DOWN);
kittudk
  • 153
  • 2
  • 2
  • 7