SeleniumSupportGenerator { public String getOptions(String locator) { return selectObjectID(locator) + ".getOptions()"; } SeleniumSupportGenerator(); String selectObjectID(String value); String isMultiple(String locator); String getOptions(String locator); String getAllSelectedOptions(String locator); String getFirstSelectedOption(String locator); String selectByVisibleText(String locator, String text); String selectByIndex(String locator, String indexNumber); String selectByValue(String locator, String value); String deselectAll(String locator); String deselectByValue(String locator, String value); String deselectByIndex(String locator, String indexNumber); String deselectByVisibleText(String locator, String text);  }
@Test public void selectObjectGetOptions() throws Exception { this.support.getOptions(webElement); assertThat(this.support.getOptions(webElement), is(equalTo("select1.getOptions()"))); }
@Test public void checkThatSelectObjectIsGeneratedByFirstCall() throws Exception { assertThat(this.support.getOptions(webElement), is(equalTo("Select select1 = new Select(driver.findElement(By.id(\"" + webElement + "\")));" + System.getProperty("line.separator") + "select1.getOptions()"))); }
@Test public void checkThatSubsequentCallWithDifferentLocatorCreatesNewSelectObject() throws Exception { this.support.getOptions(webElement); assertThat(this.support.getOptions("foo"), is(equalTo("Select select2 = new Select(driver.findElement(By.id(\"foo\")));" + System.getProperty("line.separator") + "select2.getOptions()"))); }