@Test public void testDeselectAllOptions() throws WidgetException { wd.open(url); Select s = new Select(selectMultipleLocator); s.selectOption("Car"); s.selectOption("Truck"); s.deselectAllOptions(); Assert.assertEquals(null, s.getSelectedOption()); }
@Test public void testSelectOption() throws WidgetException { wd.open(url); Select s = new Select(selectLocator); s.selectOption("Truck"); String selectedOption = s.getSelectedOption(); Assert.assertEquals("Truck", selectedOption); }
@Test(expected = WidgetException.class) public void testSelectOptionException() throws WidgetException { wd.open(url); Select s = new Select(brokeLocator); s.selectOption("not there"); }