Hi all,
First encounter with Ruby/Mechanize. I''m trying to write a script to
auto-fill a trac new ticket. I need to target the second form (with
the action "/trac/newticket#preview). I can target the first form o.k.
but not the second. I googled and found:
form = page.forms[2]
Here''s what I''m trying:
a = WWW::Mechanize.new { |agent|
agent.follow_meta_refresh = true
agent.basic_auth(TRAC_USERNAME, TRAC_PASSWORD)
}
a.get(''http://noname.org/trac/login'') do |home_page|
page = a.get(''http://noname.org/trac/newticket'')
form = page.forms[2] # form = page.forms.first works with ticket field
form.summary = ''test ticket''
pp page
end
but that isn''t working. Here''s what pp page gives me when I
target
the first form and the "ticket" field:
#<WWW::Mechanize::Page
{url #<URI::HTTP:0x1017bf668 URL:http://noname.org/trac/newticket>}
{meta}
{title "New Ticket - Dev Trac"}
{iframes}
{frames}
{links
#<WWW::Mechanize::Page::Link ""
"http://noname.org/trac/moodle/">
#<WWW::Mechanize::Page::Link "Logout"
"/trac/logout">
#<WWW::Mechanize::Page::Link "Settings"
"/trac/settings">
#<WWW::Mechanize::Page::Link "Help/Guide"
"/trac/moodle/wiki/
TracGuide">
#<WWW::Mechanize::Page::Link "About Trac"
"/trac/about">
#<WWW::Mechanize::Page::Link "Wiki" "/trac/wiki">
#<WWW::Mechanize::Page::Link "Timeline"
"/trac/timeline">
#<WWW::Mechanize::Page::Link "Roadmap"
"/trac/roadmap">
#<WWW::Mechanize::Page::Link "Browse Source"
"/trac/browser">
#<WWW::Mechanize::Page::Link "View Tickets"
"/trac/report">
#<WWW::Mechanize::Page::Link "New Ticket"
"/trac/newticket">
#<WWW::Mechanize::Page::Link "Search"
"/trac/search">
#<WWW::Mechanize::Page::Link "Admin" "/trac/admin">
#<WWW::Mechanize::Page::Link
"WikiFormatting"
"/trac/wiki/WikiFormatting">
#<WWW::Mechanize::Page::Link "TracTickets"
"/trac/wiki/TracTickets">
#<WWW::Mechanize::Page::Link "Trac Powered"
"http://trac.edgewall.org/
">
#<WWW::Mechanize::Page::Link "Trac 0.10.4"
"/trac/about">
#<WWW::Mechanize::Page::Link "Edgewall Software"
"http://www.edgewall.org/
">
#<WWW::Mechanize::Page::Link
"http://trac.edgewall.org/"
"http://trac.edgewall.org/">}
{forms
#<WWW::Mechanize::Form
{name nil}
{method "GET"}
{action "/trac/search"}
{fields
#<WWW::Mechanize::Form::Field:0x1017b5528 @name="q",
@value="">
#<WWW::Mechanize::Form::Field:0x1017b4f38 @name="wiki",
@value="on">
#<WWW::Mechanize::Form::Field:0x1017b4bf0 @name="changeset",
@value="on">
#<WWW::Mechanize::Form::Field:0x1017b48a8
@name="ticket",
@value="test ticket">}
{radiobuttons}
{checkboxes}
{file_uploads}
{buttons
#<WWW::Mechanize::Form::Button:0x1017b5258 @name=nil,
@value="Search">}>
#<WWW::Mechanize::Form
{name nil}
{method "POST"}
{action "/trac/newticket#preview"}
{fields
#<WWW::Mechanize::Form::Field:0x1017b14c8
@name="__FORM_TOKEN",
@value="58c01dd36925b540cf115fc4">
#<WWW::Mechanize::Form::Field:0x1017b1180 @name="summary",
@value="">
#<WWW::Mechanize::Form::Field:0x1017b0e38 @name="action",
@value="create">
#<WWW::Mechanize::Form::Field:0x1017b0af0 @name="status",
@value="new">
#<WWW::Mechanize::Form::Field:0x1017b07a8 @name="keywords",
@value="">
#<WWW::Mechanize::Form::Field:0x1017b0460 @name="owner",
@value="">
#<WWW::Mechanize::Form::Field:0x1017b0118 @name="cc",
@value="">
#<WWW::Mechanize::Form::Field:0x1017af308 @name="description",
@value="">
#<WWW::Mechanize::Form::SelectList:0x1017aed18
@name="type",
@options [#<WWW::Mechanize::Form::Option:0x1017addc8
@select_list=#<WWW::Mechanize::Form::SelectList:
0x1017aed18 ...>,
@selected=true,
@text="defect",
@value="defect">,
#<WWW::Mechanize::Form::Option:0x1017adc60
@select_list=#<WWW::Mechanize::Form::SelectList:
0x1017aed18 ...>,
@selected=false,
@text="enhancement",
@value="enhancement">,
#<WWW::Mechanize::Form::Option:0x1017adaf8
@select_list=#<WWW::Mechanize::Form::SelectList:
0x1017aed18 ...>,
@selected=false,
@text="task",
@value="task">],
@value=[]>
#<WWW::Mechanize::Form::SelectList:0x1017ad878
@name="priority",
@options [#<WWW::Mechanize::Form::Option:0x1017ad260
@select_list=#<WWW::Mechanize::Form::SelectList:
0x1017ad878 ...>,
@selected=false,
@text="critical",
@value="critical">,
#<WWW::Mechanize::Form::Option:0x1017ad0f8
@select_list=#<WWW::Mechanize::Form::SelectList:
0x1017ad878 ...>,
@selected=true,
@text="major",
@value="major">,
#<WWW::Mechanize::Form::Option:0x1017acf90
@select_list=#<WWW::Mechanize::Form::SelectList:
0x1017ad878 ...>,
@selected=false,
@text="minor",
@value="minor">],
@value=[]>
#<WWW::Mechanize::Form::SelectList:0x1017acd10
@name="milestone",
@options [#<WWW::Mechanize::Form::Option:0x1017ac6f8
@select_list=#<WWW::Mechanize::Form::SelectList:
0x1017acd10 ...>,
@selected=false,
@text="",
@value="">,
#<WWW::Mechanize::Form::Option:0x1017ac590
@select_list=#<WWW::Mechanize::Form::SelectList:
0x1017acd10 ...>,
@selected=false,
@text="ISLET Branch",
@value="ISLET Branch">,
#<WWW::Mechanize::Form::Option:0x1017ac428
@select_list=#<WWW::Mechanize::Form::SelectList:
0x1017acd10 ...>,
@selected=true,
@text="Sprint 4",
@value="Sprint 4">],
@value=[]>}
{radiobuttons}
{checkboxes
#<WWW::Mechanize::Form::CheckBox:0x1017afe48
@checked=false,
@name="attachment",
@value=nil>}
{file_uploads}
{buttons
#<WWW::Mechanize::Form::Button:0x1017afba0
@name="preview",
@value="Preview">
#<WWW::Mechanize::Form::Button:0x1017af8d0
@name=nil,
@value="Submit ticket">}>}>
I also installed LiveHTTPheaders and get this...
__FORM_TOKEN=65739413a411f580eade5c6d&summary=test
+ticket&type=defect&description=test
+ticket&action=create&status=new&priority=major&milestone=Sprint
+4&keywords=&owner=tbeld&cc
Thanks in advance.
-Tony
After some more testing I found that form = page.forms[1] works but not form = page.forms.first. Why is that? On Nov 2, 2009, at 10:31 PM, Tony Beld wrote:> Hi all, > First encounter with Ruby/Mechanize. I''m trying to write a script to > auto-fill a trac new ticket. I need to target the second form (with > the action "/trac/newticket#preview). I can target the first form > o.k. but not the second. I googled and found: > > form = page.forms[2] > > Here''s what I''m trying: > > a = WWW::Mechanize.new { |agent| > agent.follow_meta_refresh = true > agent.basic_auth(TRAC_USERNAME, TRAC_PASSWORD) > } > a.get(''http://noname.org/trac/login'') do |home_page| > page = a.get(''http://noname.org/trac/newticket'') > form = page.forms[2] # form = page.forms.first works with ticket field > form.summary = ''test ticket'' > pp page > end > > but that isn''t working. Here''s what pp page gives me when I target > the first form and the "ticket" field: > > #<WWW::Mechanize::Page > {url #<URI::HTTP:0x1017bf668 URL:http://noname.org/trac/newticket>} > {meta} > {title "New Ticket - Dev Trac"} > {iframes} > {frames} > {links > #<WWW::Mechanize::Page::Link "" "http://noname.org/trac/moodle/"> > #<WWW::Mechanize::Page::Link "Logout" "/trac/logout"> > #<WWW::Mechanize::Page::Link "Settings" "/trac/settings"> > #<WWW::Mechanize::Page::Link "Help/Guide" "/trac/moodle/wiki/ > TracGuide"> > #<WWW::Mechanize::Page::Link "About Trac" "/trac/about"> > #<WWW::Mechanize::Page::Link "Wiki" "/trac/wiki"> > #<WWW::Mechanize::Page::Link "Timeline" "/trac/timeline"> > #<WWW::Mechanize::Page::Link "Roadmap" "/trac/roadmap"> > #<WWW::Mechanize::Page::Link "Browse Source" "/trac/browser"> > #<WWW::Mechanize::Page::Link "View Tickets" "/trac/report"> > #<WWW::Mechanize::Page::Link "New Ticket" "/trac/newticket"> > #<WWW::Mechanize::Page::Link "Search" "/trac/search"> > #<WWW::Mechanize::Page::Link "Admin" "/trac/admin"> > #<WWW::Mechanize::Page::Link > "WikiFormatting" > "/trac/wiki/WikiFormatting"> > #<WWW::Mechanize::Page::Link "TracTickets" "/trac/wiki/TracTickets"> > #<WWW::Mechanize::Page::Link "Trac Powered" "http://trac.edgewall.org/ > "> > #<WWW::Mechanize::Page::Link "Trac 0.10.4" "/trac/about"> > #<WWW::Mechanize::Page::Link "Edgewall Software" "http://www.edgewall.org/ > "> > #<WWW::Mechanize::Page::Link > "http://trac.edgewall.org/" > "http://trac.edgewall.org/">} > {forms > #<WWW::Mechanize::Form > {name nil} > {method "GET"} > {action "/trac/search"} > {fields > #<WWW::Mechanize::Form::Field:0x1017b5528 @name="q", @value=""> > #<WWW::Mechanize::Form::Field:0x1017b4f38 @name="wiki", > @value="on"> > #<WWW::Mechanize::Form::Field:0x1017b4bf0 @name="changeset", > @value="on"> > #<WWW::Mechanize::Form::Field:0x1017b48a8 > @name="ticket", > @value="test ticket">} > {radiobuttons} > {checkboxes} > {file_uploads} > {buttons > #<WWW::Mechanize::Form::Button:0x1017b5258 @name=nil, > @value="Search">}> > #<WWW::Mechanize::Form > {name nil} > {method "POST"} > {action "/trac/newticket#preview"} > {fields > #<WWW::Mechanize::Form::Field:0x1017b14c8 > @name="__FORM_TOKEN", > @value="58c01dd36925b540cf115fc4"> > #<WWW::Mechanize::Form::Field:0x1017b1180 @name="summary", > @value=""> > #<WWW::Mechanize::Form::Field:0x1017b0e38 @name="action", > @value="create"> > #<WWW::Mechanize::Form::Field:0x1017b0af0 @name="status", > @value="new"> > #<WWW::Mechanize::Form::Field:0x1017b07a8 @name="keywords", > @value=""> > #<WWW::Mechanize::Form::Field:0x1017b0460 @name="owner", @value=""> > #<WWW::Mechanize::Form::Field:0x1017b0118 @name="cc", @value=""> > #<WWW::Mechanize::Form::Field:0x1017af308 @name="description", > @value=""> > #<WWW::Mechanize::Form::SelectList:0x1017aed18 > @name="type", > @options> [#<WWW::Mechanize::Form::Option:0x1017addc8 > @select_list=#<WWW::Mechanize::Form::SelectList: > 0x1017aed18 ...>, > @selected=true, > @text="defect", > @value="defect">, > #<WWW::Mechanize::Form::Option:0x1017adc60 > @select_list=#<WWW::Mechanize::Form::SelectList: > 0x1017aed18 ...>, > @selected=false, > @text="enhancement", > @value="enhancement">, > #<WWW::Mechanize::Form::Option:0x1017adaf8 > @select_list=#<WWW::Mechanize::Form::SelectList: > 0x1017aed18 ...>, > @selected=false, > @text="task", > @value="task">], > @value=[]> > #<WWW::Mechanize::Form::SelectList:0x1017ad878 > @name="priority", > @options> [#<WWW::Mechanize::Form::Option:0x1017ad260 > @select_list=#<WWW::Mechanize::Form::SelectList: > 0x1017ad878 ...>, > @selected=false, > @text="critical", > @value="critical">, > #<WWW::Mechanize::Form::Option:0x1017ad0f8 > @select_list=#<WWW::Mechanize::Form::SelectList: > 0x1017ad878 ...>, > @selected=true, > @text="major", > @value="major">, > #<WWW::Mechanize::Form::Option:0x1017acf90 > @select_list=#<WWW::Mechanize::Form::SelectList: > 0x1017ad878 ...>, > @selected=false, > @text="minor", > @value="minor">], > @value=[]> > #<WWW::Mechanize::Form::SelectList:0x1017acd10 > @name="milestone", > @options> [#<WWW::Mechanize::Form::Option:0x1017ac6f8 > @select_list=#<WWW::Mechanize::Form::SelectList: > 0x1017acd10 ...>, > @selected=false, > @text="", > @value="">, > #<WWW::Mechanize::Form::Option:0x1017ac590 > @select_list=#<WWW::Mechanize::Form::SelectList: > 0x1017acd10 ...>, > @selected=false, > @text="ISLET Branch", > @value="ISLET Branch">, > #<WWW::Mechanize::Form::Option:0x1017ac428 > @select_list=#<WWW::Mechanize::Form::SelectList: > 0x1017acd10 ...>, > @selected=true, > @text="Sprint 4", > @value="Sprint 4">], > @value=[]>} > {radiobuttons} > {checkboxes > #<WWW::Mechanize::Form::CheckBox:0x1017afe48 > @checked=false, > @name="attachment", > @value=nil>} > {file_uploads} > {buttons > #<WWW::Mechanize::Form::Button:0x1017afba0 > @name="preview", > @value="Preview"> > #<WWW::Mechanize::Form::Button:0x1017af8d0 > @name=nil, > @value="Submit ticket">}>}> > > I also installed LiveHTTPheaders and get this... > > __FORM_TOKEN=65739413a411f580eade5c6d&summary=test > +ticket&type=defect&description=test > +ticket&action=create&status=new&priority=major&milestone=Sprint > +4&keywords=&owner=tbeld&cc> > Thanks in advance. > > -Tony >
Unless I''ve missed something, it''s because page.forms[0] == page.forms.first and page.forms[1] == page.forms.second (if there were a "second" method on arrays). Aaron On Mon, Nov 2, 2009 at 9:01 PM, Tony Beld <tcbeld at gmail.com> wrote:> After some more testing I found that form = page.forms[1] works but not > form = page.forms.first. Why is that? > > > On Nov 2, 2009, at 10:31 PM, Tony Beld wrote: > > Hi all, >> First encounter with Ruby/Mechanize. I''m trying to write a script to >> auto-fill a trac new ticket. I need to target the second form (with the >> action "/trac/newticket#preview). I can target the first form o.k. but not >> the second. I googled and found: >> >> form = page.forms[2] >> >> Here''s what I''m trying: >> >> a = WWW::Mechanize.new { |agent| >> agent.follow_meta_refresh = true >> agent.basic_auth(TRAC_USERNAME, TRAC_PASSWORD) >> } >> a.get(''http://noname.org/trac/login'') do |home_page| >> page = a.get(''http://noname.org/trac/newticket'') >> form = page.forms[2] # form = page.forms.first works with ticket field >> form.summary = ''test ticket'' >> pp page >> end >> >> but that isn''t working. Here''s what pp page gives me when I target the >> first form and the "ticket" field: >> >> #<WWW::Mechanize::Page >> {url #<URI::HTTP:0x1017bf668 URL:http://noname.org/trac/newticket>} >> {meta} >> {title "New Ticket - Dev Trac"} >> {iframes} >> {frames} >> {links >> #<WWW::Mechanize::Page::Link "" "http://noname.org/trac/moodle/"> >> #<WWW::Mechanize::Page::Link "Logout" "/trac/logout"> >> #<WWW::Mechanize::Page::Link "Settings" "/trac/settings"> >> #<WWW::Mechanize::Page::Link "Help/Guide" "/trac/moodle/wiki/TracGuide"> >> #<WWW::Mechanize::Page::Link "About Trac" "/trac/about"> >> #<WWW::Mechanize::Page::Link "Wiki" "/trac/wiki"> >> #<WWW::Mechanize::Page::Link "Timeline" "/trac/timeline"> >> #<WWW::Mechanize::Page::Link "Roadmap" "/trac/roadmap"> >> #<WWW::Mechanize::Page::Link "Browse Source" "/trac/browser"> >> #<WWW::Mechanize::Page::Link "View Tickets" "/trac/report"> >> #<WWW::Mechanize::Page::Link "New Ticket" "/trac/newticket"> >> #<WWW::Mechanize::Page::Link "Search" "/trac/search"> >> #<WWW::Mechanize::Page::Link "Admin" "/trac/admin"> >> #<WWW::Mechanize::Page::Link >> "WikiFormatting" >> "/trac/wiki/WikiFormatting"> >> #<WWW::Mechanize::Page::Link "TracTickets" "/trac/wiki/TracTickets"> >> #<WWW::Mechanize::Page::Link "Trac Powered" "http://trac.edgewall.org/"> >> #<WWW::Mechanize::Page::Link "Trac 0.10.4" "/trac/about"> >> #<WWW::Mechanize::Page::Link "Edgewall Software" " >> http://www.edgewall.org/"> >> #<WWW::Mechanize::Page::Link >> "http://trac.edgewall.org/" >> "http://trac.edgewall.org/">} >> {forms >> #<WWW::Mechanize::Form >> {name nil} >> {method "GET"} >> {action "/trac/search"} >> {fields >> #<WWW::Mechanize::Form::Field:0x1017b5528 @name="q", @value=""> >> #<WWW::Mechanize::Form::Field:0x1017b4f38 @name="wiki", @value="on"> >> #<WWW::Mechanize::Form::Field:0x1017b4bf0 @name="changeset", >> @value="on"> >> #<WWW::Mechanize::Form::Field:0x1017b48a8 >> @name="ticket", >> @value="test ticket">} >> {radiobuttons} >> {checkboxes} >> {file_uploads} >> {buttons >> #<WWW::Mechanize::Form::Button:0x1017b5258 @name=nil, @value="Search">}> >> #<WWW::Mechanize::Form >> {name nil} >> {method "POST"} >> {action "/trac/newticket#preview"} >> {fields >> #<WWW::Mechanize::Form::Field:0x1017b14c8 >> @name="__FORM_TOKEN", >> @value="58c01dd36925b540cf115fc4"> >> #<WWW::Mechanize::Form::Field:0x1017b1180 @name="summary", @value=""> >> #<WWW::Mechanize::Form::Field:0x1017b0e38 @name="action", >> @value="create"> >> #<WWW::Mechanize::Form::Field:0x1017b0af0 @name="status", @value="new"> >> #<WWW::Mechanize::Form::Field:0x1017b07a8 @name="keywords", @value=""> >> #<WWW::Mechanize::Form::Field:0x1017b0460 @name="owner", @value=""> >> #<WWW::Mechanize::Form::Field:0x1017b0118 @name="cc", @value=""> >> #<WWW::Mechanize::Form::Field:0x1017af308 @name="description", >> @value=""> >> #<WWW::Mechanize::Form::SelectList:0x1017aed18 >> @name="type", >> @options>> [#<WWW::Mechanize::Form::Option:0x1017addc8 >> @select_list=#<WWW::Mechanize::Form::SelectList:0x1017aed18 ...>, >> @selected=true, >> @text="defect", >> @value="defect">, >> #<WWW::Mechanize::Form::Option:0x1017adc60 >> @select_list=#<WWW::Mechanize::Form::SelectList:0x1017aed18 ...>, >> @selected=false, >> @text="enhancement", >> @value="enhancement">, >> #<WWW::Mechanize::Form::Option:0x1017adaf8 >> @select_list=#<WWW::Mechanize::Form::SelectList:0x1017aed18 ...>, >> @selected=false, >> @text="task", >> @value="task">], >> @value=[]> >> #<WWW::Mechanize::Form::SelectList:0x1017ad878 >> @name="priority", >> @options>> [#<WWW::Mechanize::Form::Option:0x1017ad260 >> @select_list=#<WWW::Mechanize::Form::SelectList:0x1017ad878 ...>, >> @selected=false, >> @text="critical", >> @value="critical">, >> #<WWW::Mechanize::Form::Option:0x1017ad0f8 >> @select_list=#<WWW::Mechanize::Form::SelectList:0x1017ad878 ...>, >> @selected=true, >> @text="major", >> @value="major">, >> #<WWW::Mechanize::Form::Option:0x1017acf90 >> @select_list=#<WWW::Mechanize::Form::SelectList:0x1017ad878 ...>, >> @selected=false, >> @text="minor", >> @value="minor">], >> @value=[]> >> #<WWW::Mechanize::Form::SelectList:0x1017acd10 >> @name="milestone", >> @options>> [#<WWW::Mechanize::Form::Option:0x1017ac6f8 >> @select_list=#<WWW::Mechanize::Form::SelectList:0x1017acd10 ...>, >> @selected=false, >> @text="", >> @value="">, >> #<WWW::Mechanize::Form::Option:0x1017ac590 >> @select_list=#<WWW::Mechanize::Form::SelectList:0x1017acd10 ...>, >> @selected=false, >> @text="ISLET Branch", >> @value="ISLET Branch">, >> #<WWW::Mechanize::Form::Option:0x1017ac428 >> @select_list=#<WWW::Mechanize::Form::SelectList:0x1017acd10 ...>, >> @selected=true, >> @text="Sprint 4", >> @value="Sprint 4">], >> @value=[]>} >> {radiobuttons} >> {checkboxes >> #<WWW::Mechanize::Form::CheckBox:0x1017afe48 >> @checked=false, >> @name="attachment", >> @value=nil>} >> {file_uploads} >> {buttons >> #<WWW::Mechanize::Form::Button:0x1017afba0 >> @name="preview", >> @value="Preview"> >> #<WWW::Mechanize::Form::Button:0x1017af8d0 >> @name=nil, >> @value="Submit ticket">}>}> >> >> I also installed LiveHTTPheaders and get this... >> >> >> __FORM_TOKEN=65739413a411f580eade5c6d&summary=test+ticket&type=defect&description=test+ticket&action=create&status=new&priority=major&milestone=Sprint+4&keywords=&owner=tbeld&cc>> >> Thanks in advance. >> >> -Tony >> >> > _______________________________________________ > Mechanize-users mailing list > Mechanize-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mechanize-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/mechanize-users/attachments/20091102/a96a3ee4/attachment-0001.html>
page.forms.class == Array so you treat it just like an array with forms[0] being first. You should also be able to use page.form_with(:action => "/trac/newticket#preview"). Hope that helps! ~Jeremy Web Developer http://www.justprofessionals.com On Mon, Nov 2, 2009 at 9:01 PM, Tony Beld <tcbeld at gmail.com> wrote:> After some more testing I found that form = page.forms[1] works but not > form = page.forms.first. Why is that? > > > On Nov 2, 2009, at 10:31 PM, Tony Beld wrote: > > Hi all, >> First encounter with Ruby/Mechanize. I''m trying to write a script to >> auto-fill a trac new ticket. I need to target the second form (with the >> action "/trac/newticket#preview). I can target the first form o.k. but not >> the second. I googled and found: >> >> form = page.forms[2] >> >> Here''s what I''m trying: >> >> a = WWW::Mechanize.new { |agent| >> agent.follow_meta_refresh = true >> agent.basic_auth(TRAC_USERNAME, TRAC_PASSWORD) >> } >> a.get(''http://noname.org/trac/login'') do |home_page| >> page = a.get(''http://noname.org/trac/newticket'') >> form = page.forms[2] # form = page.forms.first works with ticket field >> form.summary = ''test ticket'' >> pp page >> end >> >> but that isn''t working. Here''s what pp page gives me when I target the >> first form and the "ticket" field: >> >> #<WWW::Mechanize::Page >> {url #<URI::HTTP:0x1017bf668 URL:http://noname.org/trac/newticket>} >> {meta} >> {title "New Ticket - Dev Trac"} >> {iframes} >> {frames} >> {links >> #<WWW::Mechanize::Page::Link "" "http://noname.org/trac/moodle/"> >> #<WWW::Mechanize::Page::Link "Logout" "/trac/logout"> >> #<WWW::Mechanize::Page::Link "Settings" "/trac/settings"> >> #<WWW::Mechanize::Page::Link "Help/Guide" "/trac/moodle/wiki/TracGuide"> >> #<WWW::Mechanize::Page::Link "About Trac" "/trac/about"> >> #<WWW::Mechanize::Page::Link "Wiki" "/trac/wiki"> >> #<WWW::Mechanize::Page::Link "Timeline" "/trac/timeline"> >> #<WWW::Mechanize::Page::Link "Roadmap" "/trac/roadmap"> >> #<WWW::Mechanize::Page::Link "Browse Source" "/trac/browser"> >> #<WWW::Mechanize::Page::Link "View Tickets" "/trac/report"> >> #<WWW::Mechanize::Page::Link "New Ticket" "/trac/newticket"> >> #<WWW::Mechanize::Page::Link "Search" "/trac/search"> >> #<WWW::Mechanize::Page::Link "Admin" "/trac/admin"> >> #<WWW::Mechanize::Page::Link >> "WikiFormatting" >> "/trac/wiki/WikiFormatting"> >> #<WWW::Mechanize::Page::Link "TracTickets" "/trac/wiki/TracTickets"> >> #<WWW::Mechanize::Page::Link "Trac Powered" "http://trac.edgewall.org/"> >> #<WWW::Mechanize::Page::Link "Trac 0.10.4" "/trac/about"> >> #<WWW::Mechanize::Page::Link "Edgewall Software" " >> http://www.edgewall.org/"> >> #<WWW::Mechanize::Page::Link >> "http://trac.edgewall.org/" >> "http://trac.edgewall.org/">} >> {forms >> #<WWW::Mechanize::Form >> {name nil} >> {method "GET"} >> {action "/trac/search"} >> {fields >> #<WWW::Mechanize::Form::Field:0x1017b5528 @name="q", @value=""> >> #<WWW::Mechanize::Form::Field:0x1017b4f38 @name="wiki", @value="on"> >> #<WWW::Mechanize::Form::Field:0x1017b4bf0 @name="changeset", >> @value="on"> >> #<WWW::Mechanize::Form::Field:0x1017b48a8 >> @name="ticket", >> @value="test ticket">} >> {radiobuttons} >> {checkboxes} >> {file_uploads} >> {buttons >> #<WWW::Mechanize::Form::Button:0x1017b5258 @name=nil, @value="Search">}> >> #<WWW::Mechanize::Form >> {name nil} >> {method "POST"} >> {action "/trac/newticket#preview"} >> {fields >> #<WWW::Mechanize::Form::Field:0x1017b14c8 >> @name="__FORM_TOKEN", >> @value="58c01dd36925b540cf115fc4"> >> #<WWW::Mechanize::Form::Field:0x1017b1180 @name="summary", @value=""> >> #<WWW::Mechanize::Form::Field:0x1017b0e38 @name="action", >> @value="create"> >> #<WWW::Mechanize::Form::Field:0x1017b0af0 @name="status", @value="new"> >> #<WWW::Mechanize::Form::Field:0x1017b07a8 @name="keywords", @value=""> >> #<WWW::Mechanize::Form::Field:0x1017b0460 @name="owner", @value=""> >> #<WWW::Mechanize::Form::Field:0x1017b0118 @name="cc", @value=""> >> #<WWW::Mechanize::Form::Field:0x1017af308 @name="description", >> @value=""> >> #<WWW::Mechanize::Form::SelectList:0x1017aed18 >> @name="type", >> @options>> [#<WWW::Mechanize::Form::Option:0x1017addc8 >> @select_list=#<WWW::Mechanize::Form::SelectList:0x1017aed18 ...>, >> @selected=true, >> @text="defect", >> @value="defect">, >> #<WWW::Mechanize::Form::Option:0x1017adc60 >> @select_list=#<WWW::Mechanize::Form::SelectList:0x1017aed18 ...>, >> @selected=false, >> @text="enhancement", >> @value="enhancement">, >> #<WWW::Mechanize::Form::Option:0x1017adaf8 >> @select_list=#<WWW::Mechanize::Form::SelectList:0x1017aed18 ...>, >> @selected=false, >> @text="task", >> @value="task">], >> @value=[]> >> #<WWW::Mechanize::Form::SelectList:0x1017ad878 >> @name="priority", >> @options>> [#<WWW::Mechanize::Form::Option:0x1017ad260 >> @select_list=#<WWW::Mechanize::Form::SelectList:0x1017ad878 ...>, >> @selected=false, >> @text="critical", >> @value="critical">, >> #<WWW::Mechanize::Form::Option:0x1017ad0f8 >> @select_list=#<WWW::Mechanize::Form::SelectList:0x1017ad878 ...>, >> @selected=true, >> @text="major", >> @value="major">, >> #<WWW::Mechanize::Form::Option:0x1017acf90 >> @select_list=#<WWW::Mechanize::Form::SelectList:0x1017ad878 ...>, >> @selected=false, >> @text="minor", >> @value="minor">], >> @value=[]> >> #<WWW::Mechanize::Form::SelectList:0x1017acd10 >> @name="milestone", >> @options>> [#<WWW::Mechanize::Form::Option:0x1017ac6f8 >> @select_list=#<WWW::Mechanize::Form::SelectList:0x1017acd10 ...>, >> @selected=false, >> @text="", >> @value="">, >> #<WWW::Mechanize::Form::Option:0x1017ac590 >> @select_list=#<WWW::Mechanize::Form::SelectList:0x1017acd10 ...>, >> @selected=false, >> @text="ISLET Branch", >> @value="ISLET Branch">, >> #<WWW::Mechanize::Form::Option:0x1017ac428 >> @select_list=#<WWW::Mechanize::Form::SelectList:0x1017acd10 ...>, >> @selected=true, >> @text="Sprint 4", >> @value="Sprint 4">], >> @value=[]>} >> {radiobuttons} >> {checkboxes >> #<WWW::Mechanize::Form::CheckBox:0x1017afe48 >> @checked=false, >> @name="attachment", >> @value=nil>} >> {file_uploads} >> {buttons >> #<WWW::Mechanize::Form::Button:0x1017afba0 >> @name="preview", >> @value="Preview"> >> #<WWW::Mechanize::Form::Button:0x1017af8d0 >> @name=nil, >> @value="Submit ticket">}>}> >> >> I also installed LiveHTTPheaders and get this... >> >> >> __FORM_TOKEN=65739413a411f580eade5c6d&summary=test+ticket&type=defect&description=test+ticket&action=create&status=new&priority=major&milestone=Sprint+4&keywords=&owner=tbeld&cc>> >> Thanks in advance. >> >> -Tony >> >> > _______________________________________________ > Mechanize-users mailing list > Mechanize-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mechanize-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/mechanize-users/attachments/20091103/18e621ac/attachment.html>