public boolean isValuePresentInDropDown(final By by, final String value) {
		WebElement element = driver.findElement(by);

		StringBuilder builder = new StringBuilder(".//option[@value = ");
		builder.append(escapeQuotes(value));
		builder.append("]");
		List<WebElement> options = element.findElements(By.xpath(builder
				.toString()));

		return options != null && !options.isEmpty();
	}
public boolean isValuePresentInDropDown ( final By by , final String value ) { WebElement element = driver . findElement ( by ) ; StringBuilder builder = new StringBuilder ( ".//option[@value = " ) ; builder . append ( escapeQuotes ( value ) ) ; builder . append ( "]" ) ; List < WebElement > options = element . findElements ( By . xpath ( builder . toString ( ) ) ) ; return options != null && ! options . isEmpty ( ) ; }
Checks if the VALUE is present in the drop-down. This considers the VALUE
attribute of the option, not the actual display text. <br/>
For example if we have the following situation: &lt;select id="test"&gt;
&lt;option value="4"&gt;June&lt;/option&gt; &lt;/select&gt; we will call
the method as follows: isValuePresentInDropDown(By.id("test"), "4");

@param by
he method of identifying the drop-down
@param value
the value to search for
@return true if the value is present in the drop-down or false otherwise