in reply to choosing option value in test script.

From the WWW::Mechanize documentation:
$mech->select($name, \@values)

Given the name of a select field, set its value to the value specified. If the field is not <select multiple> and the $value is an array, only the first value will be set. [Note: the documentation previously claimed that only the last value would be set, but this was incorrect.] Passing $value as a hash with an n key selects an item by number (e.g. {n => 3} or { {n = [2,4]} >>). The numbering starts at 1. This applies to the current form.

Returns 1 on successfully setting the value. On failure, returns undef and calls $self>warn() with an error message.

Without knowing what the options are, you can just loop from 1 until the select fails.

  • Comment on Re: choosing option value in test script.

Replies are listed 'Best First'.
Re^2: choosing option value in test script.
by wst (Acolyte) on Apr 30, 2009 at 18:37 UTC
    I did try that, and unfortunately, instead of selecting/finding, what it does it submits to database, with the value of select. (which is not what I want though. )

    Thanks Kenneth for help!