2
votes

I am trying to test a link, I hope I can solve this issue:

I tried to test the link like this:

nested_element= "div.page_margins div.page iv#nav div.hlist ul li#2"

within(nested_element) do
        response.body.should have_link("Next", :href=>"javascript: void(0)")
end

But I get this error:

Capybara::ElementNotFound: Unable to find css "div.page_margins div.page div#nav div.hlist ul li#2"

Although the same selector is working fine using have_selector:

response.body.should have_selector(nested_element)

Any idea please ?

1

1 Answers

-1
votes

I had a similar issue, and opened a bug report here: https://github.com/jnicklas/capybara/issues/658

I used git bisect to track down the guilty commit. Unfortunately, the commit causing my problem was from Jan 31, so our problems aren't likely the same. However, if anybody else has a similar problem try an older version of capybara before the breakage.