0

I am using mocha for testing.

With zombie.js, one can navigate to a webpage asynchronously like:

browser.visit(referrer, function(){
        browser.clickLink('.myLinkClass', function(){ 
            assert(browser.field('referrer').value === referrer);
            done();
        });
    });

But with selenium, you do:

driver.get('http://www.google.com');

The documentation does not mention any asynchronous callback that you can pass when the page is loaded. Is this feature absent ?

Rahul Iyer
  • 19,924
  • 21
  • 96
  • 190
  • Does `webdriver.execute_async_script` not do that? – Nope Sep 11 '17 at 11:37
  • This SO post seems to address loading pages with ajax when using `.get` https://stackoverflow.com/questions/5664808/difference-between-webdriver-get-and-webdriver-navigate – Nope Sep 11 '17 at 11:39
  • @Fran that post describes the differences between get and navigate. It doesn't talk about ensuring that the page is loaded asynchronously. – Rahul Iyer Sep 11 '17 at 11:45
  • check the answer. It states that it recommends the use of `waits` if you use `get` on an ajax heavy page. `...If you need to ensure such pages are fully loaded then you can use waits` – Nope Sep 11 '17 at 11:47
  • 1
    There is a difference between how both libraries are implemented. When you do `driver.get('http://www.google.com');` it schedules the operation in a queue. Read this article for more details http://www.assertselenium.com/selenium/promise-manager-in-webdriverjs/ – Tarun Lalwani Sep 11 '17 at 11:59

0 Answers0