package com.sdl.selenium.web.form;

import com.sdl.selenium.web.WebDriverConfig;
import com.sdl.selenium.web.WebLocator;
import org.apache.log4j.Logger;
import org.openqa.selenium.support.ui.Select;

public class SimpleComboBox extends WebLocator implements ICombo {
    private static final Logger logger = Logger.getLogger(SimpleComboBox.class);

    public SimpleComboBox() {
        setClassName("SimpleComboBox");
        setTag("select");
    }

    public SimpleComboBox(WebLocator container) {
        this();
        setContainer(container);
    }

    @Override
    public boolean select(String value) {
        if (ready()) {
            if (WebDriverConfig.hasWebDriver()) {
                if ("".equals(value)) {
                    return true;
                } else {
                    new Select(currentElement).selectByVisibleText(value);
                    return true;
                }
            } else {
                selenium.select(getPath(), value);
                return true;
            }
        }
        return false;
    }

    @Override
    public boolean setValue(String value) {
        return select(value);
    }

    @Override
    public String getValue() {
        String value = this.getAttribute("value");
        return new WebLocator(this, "//option[contains(@value, '" + value + "')]").getHtmlText();
    }
}

@@ -197,16 +197,60 @@
 Select;%0D
+%0Aimport sun.util.logging.resources.logging;%0D
 %0A%0D%0Apubli
@@ -665,32 +665,67 @@
 tring value) %7B%0D%0A
+        boolean selected = false;%0D%0A
         if (read
@@ -836,38 +836,94 @@
                 
-return
+logger.warn(%22value is empty%22);%0D%0A                    selected =
  true;%0D%0A        
@@ -1028,38 +1028,42 @@
                 
-return
+selected =
  true;%0D%0A        
@@ -1163,22 +1163,26 @@
         
-return
+selected =
  true;%0D%0A
@@ -1219,20 +1219,122 @@
     
-return false
+if (selected) %7B%0D%0A            logger.info(%22Set value(%22 + this + %22): %22 + value);%0D%0A        %7D%0D%0A        return selected
 ;%0D%0A 

add logging when select value