Mechanize::Form
Inherits Mechanize::ElementMatcher / Reference / Object
This class represents the form tag of html.
Constructors
Instance methods
add_button_to_query(button)
This method adds a button to the query. If the form needs to be submitted with multiple buttons, pass each button to this method.
buttons
returns an array of button tags and input tag whose type is button,submit,reset,image.
buttons_with(criteria : String | NamedTuple | Hash(String, String))
search buttons which match condition.
Examples
# if you specify String like "foo", it searches button which name is "foo".
# like <button name="foo"></button>
page.buttons_with("foo")
# you can also specify tag's attribute and its' value by NamedTuple or Hash(String, String).
# ex) <button class="foo"></button>
page.buttons_with("class" => "foo")
page.buttons_with(class: "foo")
buttons_with(criteria, &)
Sourcecheckboxes_with(criteria : String | NamedTuple | Hash(String, String))
search checkboxes which match condition.
Examples
# if you specify String like "foo", it searches checkbox which name is "foo".
# like <input type="checkbox" name="foo"></input>
page.checkboxes_with("foo")
# you can also specify tag's attribute and its' value by NamedTuple or Hash(String, String).
# ex) <input type="checkbox" class="foo"></input>
page.checkboxes_with("class" => "foo")
page.checkboxes_with(class: "foo")
checkboxes_with(criteria, &)
Sourcefields_with(criteria : String | NamedTuple | Hash(String, String))
search fields which match condition.
Examples
# if you specify String like "foo", it searches field which name is "foo".
# like <input name="foo"></input>
page.fields_with("foo")
# you can also specify tag's attribute and its' value by NamedTuple or Hash(String, String).
# ex) <input class="foo"></input>
page.fields_with("class" => "foo")
page.fields_with(class: "foo")
fields_with(criteria, &)
Sourcenode
Sourceradiobuttons_with(criteria : String | NamedTuple | Hash(String, String))
search radiobuttons which match condition.
Examples
# if you specify String like "foo", it searches radiobutton which name is "foo".
# like <input type="radio" name="foo"></input>
page.radiobuttons_with("foo")
# you can also specify tag's attribute and its' value by NamedTuple or Hash(String, String).
# ex) <input type="radio" class="foo"></input>
page.radiobuttons_with("class" => "foo")
page.radiobuttons_with(class: "foo")
radiobuttons_with(criteria, &)
Sourcerequest_data
Source