Merc
Merc

Reputation: 17077

Waiting for Ajax to be finished with selenium-webdriver in node

I have a single page application and am writing integration tests. I am using the selenium-webdriver, using the node API (no Java).

When the user clicks on a button, an AJAX call is initiated. I would like to check what returns from that AJAX call.

Not sure it's relevant: I am not using JQuery, but Polymer (iron-ajax to be exact).

I have found some documentation online, but nothing specific for node.

Upvotes: 0

Views: 409

Answers (1)

Eugene S
Eugene S

Reputation: 6910

Without getting into specifics of node.js, there is no single way to reliably determine that an ajax based resource has been fully loaded. In such case, what you need to do, is to create a combination of certain rules that in summary will be used to "detect" a full page load. Just few examples that can be used together to confirm fully loaded page:

  1. If there are any certain areas that you know will only be fully visible after a page has loaded.
  2. Any spinners or wait signs that appear on a page while it is still loaded.
  3. Use jQuery to assess page load status.

All the above (but possibly more or less) should be used together as a combination.

Upvotes: 1

Related Questions