cucumber+webrat+selenium not waiting for response

Skip to first unread message

Scott Johnson

May 29, 2009, 9:00:36 PM5/29/09
to webrat
I have this combo running (followed instructions on,
but I'm getting lots of failures in my features because Webrat will
click a button (say), then immediately check the next Then step
(assertion) before the browser has followed the link and gone to the
next page. For example:

And I press "Create" #
Then I should be on the Foo Profile: my_new_profile page #
expected: "/profiles/19",
got: "/spaces/Foo/profiles/new" (using ==)

But the browser was on the way to /profiles/19, just hadn't made it
there yet.

This happens with form buttons and with regular links.

I've already added a step that I thought would cause it to wait, and
it helped somewhat, but not fully.

Then /^I should be on (.+)$/ do |page_name|
response.should contain(/./) # make webrat wait for some response to
URI.parse(current_url).path.should == path_to(page_name)

Scott Johnson

May 29, 2009, 9:07:06 PM5/29/09
to webrat
I should mention that this particular case involves a redirect, but I
have other failing cases that do not have any redirect.

On May 29, 6:00 pm, Scott Johnson <> wrote:
> I have this combo running (followed instructions on,

Scott Johnson

May 30, 2009, 5:17:09 AM5/30/09
to webrat
Looks like this is a known issue. I guess I'll just hang on to my hat.
Reply all
Reply to author
0 new messages