I added a DOM element (link) with jQuery. I can see an element in Firebug, but for some reason Selenium cannot find it. What's going on here?
Note: AJAX is not involved, so the DOM element is added almost immediately.
== EDIT ==
Here is some code (using jQuery) that adds a link to the end of the document:
$element = $("<a id="foo" href="
$element.appendTo($("body"));
I use Capybara (with Selenium) to find the link and click it like this:
find("#foo").click
I had no problems with Capybara or Selenium until I started adding elements to the DOM using jQuery.
source
share