I added a DOM element (a link) with jQuery. I can see the element in Firebug, but for some reason Selenium can't find it. What is going on here?
Note: there is no AJAX involved, so the DOM element is added almost immediately.
== EDIT ==
Here's some code (using jQuery) that appends a link to the end of the document:
$element = $("<a id="foo" href="#"></a>");
$element.appendTo($("body"));
I'm using Capybara (with Selenium) to find the link and click it, like so:
find("#foo").click
I was having no problems with Capybara or Selenium until I started adding elements to the DOM with jQuery.
Try to use waitForElementPresent in your test code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With