Package org.openqa.selenium.support.ui

Examples of org.openqa.selenium.support.ui.Select


    WebElement option = getSelectedOption(selectElement);
    return option == null ? null : option.getText();
  }

  protected SelenideElement getSelectedOption(WebElement selectElement) {
    return wrap(new Select(selectElement).getFirstSelectedOption());
  }
View Full Code Here


        values.add(new InputValue("1", true));
      } else {
        values.add(new InputValue("0", false));
      }
    } else if (inputString.equals("select")) {
      Select select = new Select(webElement);
      if (!select.getOptions().isEmpty()) {
        WebElement option =
                new RandomInputValueGenerator().getRandomItem(select.getOptions());
        values.add(new InputValue(option.getText(), true));
      }

    }
  }
View Full Code Here

  }

  protected void selectOptionByText(WebElement selectField, String optionText) {
    $(selectField).should(exist);
    $(selectField).find(byText(optionText)).shouldBe(visible);
    new Select(selectField).selectByVisibleText(optionText);
  }
View Full Code Here

  }

  protected void selectOptionByValue(WebElement selectField, String optionValue) {
    $(selectField).should(exist);
    $(selectField).find(byValue(optionValue)).shouldBe(visible);
    new Select(selectField).selectByValue(optionValue);
  }
View Full Code Here

    WebElement option = getSelectedOption(selectElement);
    return option == null ? null : option.getText();
  }

  protected SelenideElement getSelectedOption(WebElement selectElement) {
    return wrap(new Select(selectElement).getFirstSelectedOption());
  }
View Full Code Here

    return null;
  }

  public static Select select(By selectField) {
    return new Select(getElement(selectField));
  }
View Full Code Here

        changeFieldValue("tab_title", value);
    }

    @When("I choose the two column layout")
    public void selectTwoColumnLayout() {
        final Select layouts = new Select(portal.findElement(By.id("pageLayout")));
        layouts.selectByValue("columns_2");
    }
View Full Code Here

        changeFieldValue("aboutMeField", aboutMe);
    }

    @When("I choose the status as \"$status\"")
    public void changeStatus(String status) {
        final Select relationshipStatus = new Select(portal.findElement(By.id("statusField")));
        relationshipStatus.selectByValue(status);
    }
View Full Code Here

      public Select apply( WebDriver driver )
      {
        WebElement foundElement = driver.findElement(locator);
        if (foundElement != null)
        {
          Select select = new Select( foundElement );
          if (select.getOptions().size() >= index)
          {
            return select;
          }
        }
        // TBD: or throw NoSuchException...
View Full Code Here

    return new File(canonicalPath);
  }

  protected void selectOptionByText(WebElement selectField, String optionText) {
    $(selectField).should(exist).find(byText(optionText)).shouldBe(visible);
    new Select(selectField).selectByVisibleText(optionText);
  }
View Full Code Here

TOP

Related Classes of org.openqa.selenium.support.ui.Select

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.