Mechanize: save and cancel doesn't work in JSPWiki

M

michele

I'm trying to submit data in JSPWiki (edit page). I can read the data
in the form, but nothings get saved when I submit the page. Cancel
doesn't work either. I don't get any errors. There is no JavaScript
used to submit the form.

After I'm logged in I do the following:

def save(page, content)
@agent.get(@base_url + "Edit.jsp?page=#{page}")
form = @agent.page.forms.with.name('editForm')
form.fields.name('_editedtext').value = content
form.submit(form.buttons.first)
end


And this is the cancel method (the @agent already got the edit page)

def cancel
form = @agent.page.forms.with.name('editForm')
form.submit(form.buttons.name('cancel'))
end


Michele
 
A

Aaron Patterson

I'm trying to submit data in JSPWiki (edit page). I can read the data
in the form, but nothings get saved when I submit the page. Cancel
doesn't work either. I don't get any errors. There is no JavaScript
used to submit the form.

After I'm logged in I do the following:

def save(page, content)
@agent.get(@base_url + "Edit.jsp?page=#{page}")
form = @agent.page.forms.with.name('editForm')
form.fields.name('_editedtext').value = content
form.submit(form.buttons.first)
end


And this is the cancel method (the @agent already got the edit page)

def cancel
form = @agent.page.forms.with.name('editForm')
form.submit(form.buttons.name('cancel'))
end

Can you try turning on logging, and sending the log to the
mechanize-users mailing list?

http://rubyforge.org/mail/?group_id=1453

Then I can try to help you out more.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,215
Messages
2,571,113
Members
47,708
Latest member
SharonMaes

Latest Threads

Top