in reply to choosing option value in test script.

Look again, in the documentation of WWW::Mechanize. There is ->find_all_inputs(...), which returns HTML::Form::Input elements that you can query in turn.

Replies are listed 'Best First'.
Re^2: choosing option value in test script.
by wst (Acolyte) on Apr 30, 2009 at 18:35 UTC
    ahh that's the one I didn't see. Thanks Corion for that!
      Corion, update: updated select to option (as thats the type ) I tried the find_all_inputs() but am getting this error. (I am not sure if select option is called select? or option? did try both and still got this error. Any help would be appreciated!!
      my @teacher_input = $mech->find_all_inputs( { type => 'option', name => 'teacher', } ); Reference found where even-sized list expected at /usr/local/share/per +l/5.10.0/WWW/Mechanize.pm line 973. at /usr/local/share/perl/5.10.0/WWW/Mechanize.pm line 973
      I was using the example in the WM doc, and used type instead of type_regex.
      # get all text or textarea controls called "customer" my @customer_text_inputs = $mech->find_all_inputs( { type_regex => qr/^(text|textarea)$/, name => 'customer', } );


      Thanks for help once again in advance!