0

I'm working with java and htmlunit.

I have this input in a web page:

<input
    id="hddn_crit_1_from1"
    name="crit_1_from"
    class="nldropdown"
    value="53"
    onchange="
        if(!this.noslaving) {
            setWindowChanged(window, true);
        }
        NS.jQuery('#crit_1_mod-root').data('controller').setValue('CUSTOM');
        return validatePeriodRange(
            document.forms['footerform'].elements['crit_1_from'],
            document.forms['footerform'].elements['crit_1_to']);"
    type="hidden">

Which on the website looks like a field that allows you to select Select dates (Jan 2014, Feb 2014, etc.). Each of these fields has an associated value, for example Jan 2014 corresponds to value = 3 February 2014 value = 4, etc.

How I can with htmlunit a list of all these fields (text date and value)?

Thamilhan
  • 13,040
  • 5
  • 37
  • 59
Chris2141
  • 37
  • 3
  • 10

1 Answers1

0

In HTMLUnit, In Java code use this option to get the text, instead of value.

public HtmlOption getOptionByText(String text)
                           throws ElementNotFoundException
public String asText()

and also this.

   public HtmlOption getOption(int index)
Sireesh Yarlagadda
  • 12,978
  • 3
  • 74
  • 76
  • But that option be able to get all possible values that can take input? since this input on the website looks like a select has options available to the user selects. – Chris2141 Aug 21 '15 at 14:31