Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple submits to/from same page only submit the first time #74

Open
patrickhno opened this issue Jul 8, 2011 · 5 comments
Open

multiple submits to/from same page only submit the first time #74

patrickhno opened this issue Jul 8, 2011 · 5 comments

Comments

@patrickhno
Copy link

Ive narrowed a problem I'm having down to this.

I have these cucumber steps:
And I press "Save"
And I press "Save"

I tcpdump the connection to the web server.

And I see one POST.

It do not matter if i put a second visit in between or nothing. The second press never leads to a commit.

Can someone elaborate what is going on?

The second step pass in cucumber btw.
My tests fail on later expectations as the submits never happened.

@patrickhno
Copy link
Author

I have now also verified that this works perfectly with the selenium web driver.

@patrickhno
Copy link
Author

I even tried to press the button with javascript, and it still fails.
page.driver.execute_script("document.getElementById('save_button').click();")

@Nerian
Copy link
Contributor

Nerian commented Jul 11, 2011

Hi Patrick,

I think that instructions sent to the HTMLUnit driver are atomic. Meaning the second click on the save button is not sent until the first has finished. It makes sense on a headlesss driver.

What happen if you do this?:

page.driver.execute_script("
  document.getElementById('save_button').click();
  document.getElementById('save_button').click();")

@patrickhno
Copy link
Author

Hi Nerian,

I am not actually trying to click a button twice. That is the result of narrowing the bug description down to a isolated case.
My need is to submit a form multiple times, like when you change search parameters and click ok.
It really bugs me that akephalos doesnt seem to support such behaviour.

I do not even receive a POST to apache on the second click with akephalos, no matter if its javascript, direct API calls or whatever.

I have full blown tests now that works perfectly with other drivers, but not at all with akephalos, as it refuses to POST to or from pages it has posted to/from before, or something like that.

I have not figured out exactly what in the code that does this. It seems to be deeper down into the htmlunit interface or something.

@Nerian
Copy link
Contributor

Nerian commented Oct 16, 2011

Hi Patrick,

Do you still have this problem in https://github.com/Nerian/akephalos2 ?

I tried to reproduce this bug, but it works fine for me.

it "Should be able to make four requests to the same page" do
session.visit '/form'
session.click_button 'Submit'
session.click_button 'Submit'
session.click_button 'Submit'
session.body.should include('visit_number:4')
end

Is this what you were trying to do? Can you provide a failing example?

Issue a bug report at https://github.com/Nerian/akephalos2

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants