Ejemplo n.º 1
0
  @Test
  public void shouldAllowUserToDeselectOptionsByVisibleText() {
    WebElement selectElement = driver.findElement(By.name("multi"));
    Select select = new Select(selectElement);
    select.deselectByVisibleText("Eggs");
    List<WebElement> returnedOptions = select.getAllSelectedOptions();

    assertEquals(1, returnedOptions.size());
  }
Ejemplo n.º 2
0
 @Test(expected = NoSuchElementException.class)
 public void shouldNotAllowUserToDeselectOptionsByInvisibleText() {
   WebElement selectElement = driver.findElement(By.name("invisi_select"));
   Select select = new Select(selectElement);
   select.deselectByVisibleText("Apples");
 }
Ejemplo n.º 3
0
 public void deselectByVisibleText() {
   select.deselectByVisibleText(getData());
 }