Handling Ajax dropdown - Webdriver



Below code types the value in the given dropdown   

  public void Dropdown1(String eleproperty, String value) {
            WebElement element = driver.findElement(By.id(eleproperty));
            if (element.isEnabled()) {
                  element.sendKeys(value);
                  Sleep();

            } else {
                  System.out.println("object is disable");
            }

            String actval = driver.findElement(By.id(eleproperty)).getAttribute("value");
            if (value.equals(actval)) {
                  System.out.println(actval);
            }
      }

Contributed by: Ch. Suma