always get the blank screen when I capture

48 views
Skip to first unread message

pra...@tersesoft.com

unread,
Jul 4, 2017, 2:17:55 AM7/4/17
to CasperJS

I am trying to hit a page https://portal.checkuphc.com/login using Casperjs, page is built using Angularjs1.5 component based.

I always get the blank screen when I capture. I tried with casper.waitForSelector, this.wait but no luck. Any help is really appreciated.


var casper = require('casper').create({

    engine: 'slimmerjs',

    verbose: true,

    logLevel: 'debug',

    exitOnError: false,

    ignoreSslErrors: false,

    pageSettings: {

        javascriptEnabled: true,

        loadImages: true,

        loadPlugins: true,

        localToRemoteUrlAccessEnabled: true,

        userAgent: 'Mozilla/5.0 (X11; CrOS x86_64 8172.45.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.64 Safari/537.36',

        XSSAuditingEnabled: false,

        logLevel: 'debug'

    }

});

phantom.casperTest = true;

casper.test.begin('Testing checkup', 1, function(test) {

        casper.start('https://portal.checkuphc.com/login', function() {

        casper.capture('screenshots/portal-checkup-search-1.png');

  });

  casper.run(function() {

    test.done();

  });

});

Ken

unread,
Jul 4, 2017, 11:44:04 AM7/4/17
to CasperJS
I can replicate and having the same issue even with security settings set to relaxed. Every once in a while I encounter something like this. The last time was Mastodon website, somehow PhantomJS just cannot render the webpage beyond the login page. CasperJS main maintainer is now working to let CasperJS support Chrome (and thus headless Chrome). Once that is done it might take care of these type of cases. I'm also close to finish integration with Chrome for a web automation project I doing base on CasperJS. 

The Chrome debugging protocol API has many experimental parts but over time it should hopefully address issues like this. Also, your slimerjs there is typo, it should be slimerjs without double 'm'. I normally launch it with commandline option  --engine=slimerjs and the Mastodon website also works when run with SlimerJS + Firefox. It just doesn't work with PhantomJS when I tried it some weeks back.
Reply all
Reply to author
Forward
0 new messages