Running 'casperjs test' in phantom

后端 未结 2 654
北荒
北荒 2020-12-19 19:25

So I have a file running in node which runs a local copy of PhantomJS as below shows:

phantom.casperPath = \'node_modules/casperjs\';
phantom.injectJs(\'node         


        
2条回答
  •  我在风中等你
    2020-12-19 20:06

    CasperError: casper.test property is only available using the casperjs test command

    problem solved.

    You have to include this line at the top of your script in your xyz.js, so that the .test property becomes true;

    phantom.casperTest = true;
    

    Then you should have no problem Launching from the terminal:

    casperjs xyz.js
    

提交回复
热议问题