Package com.gargoylesoftware.htmlunit.html

Examples of com.gargoylesoftware.htmlunit.html.HtmlOption.asText()


        assertNotNull(element);
        assertEquals("choice description", ((HtmlElement) element.selectSingleNode("td/div")).getAttribute("description"));
        assertEquals("choice", ((HtmlElement) element.selectSingleNode("td[@class='setting-name']")).getTextContent());
        HtmlOption opt = (HtmlOption)element.selectSingleNode("td/div/select/option[@value='Choice <2>']");
        assertNotNull(opt);
        assertEquals("Choice <2>", opt.asText());
        opt.setSelected(true);

        submit(form);
        Queue.Item q = hudson.getQueue().getItem(project);
        if (q != null) q.getFuture().get();
View Full Code Here


  private HtmlOption getOptionForText(final HtmlSelect select, final String text) {
    final IStringVerifier verifier = getVerifier(fIsRegex);
    for (final Iterator iter = select.getOptions().iterator(); iter.hasNext();) {
      final HtmlOption option = (HtmlOption) iter.next();
      LOG.debug("Examining option: " + option);
      if (verifier.verifyStrings(text, option.asText())) {
        LOG.debug("Found option by text: " + option);
        return option;
      }
    }
    throw new StepFailedException("No option element found with text \"" + text + "\"", this);
View Full Code Here

  protected void verifyField(final HtmlElement field) throws IOException {
    final HtmlSelect curSelect = (HtmlSelect) field;
    for (final Iterator iter = curSelect.getOptions().iterator(); iter.hasNext();) {
      final HtmlOption curOption = (HtmlOption) iter.next();

      if ((getText() == null || verifyStrings(getText(), curOption.asText()))
        && (getValue() == null || verifyStrings(getValue(), curOption.getValueAttribute()))) {
        LOG.debug("Found corresponding option " + curOption);
        if (curOption.isSelected()) {
          return;
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.