javascript - Set select on form using casperjs -
my form has 2 select boxes in user can pick countries included in settings. values of available options this:
<option value="au">australia</option>
when form submitted, chrome reports state of select this:
f_countries:selectedc selectedcountries[]:au selectedcountries[]:ar
on casperjs can use following method things such type in input boxes, etc., on form. can't figure out how set select form values listed above.
for example, wanted set selected countries "us,ca,br".
here use other types of input on forms.
this.fill('form#my_form', { 'username': 'joe', 'password': 'secret', 'f_countries:selectedc': [[ can't figure out goes here ]] }, true);
question is: how use casperjs set values of selects on forms.
if simple select box, try using
selector : 'value'
if multi select box , refer https://groups.google.com/forum/#!topic/casperjs/1iobxfhfbuu
Comments
Post a Comment