0

I am using phantomjs for testing one web application. but i am facing problem with page load means sometimes phantom script executed but dom element is not loaded. How to use callbacks for sorting this kind of issues

resourceReceived(request),resourceRequested(resource),resourceError(resource)

4

1 回答 1

1

If you want to execute code after the page has finished loading, use this:

page.onLoadFinished = function() 
{
    // function body
    var pageTitle = page.evaluate(function() {
            console.log('Page Name: ' + document.title);
            return document.title;
    });
};
于 2013-08-23T12:33:16.597 回答