Giter Club home page Giter Club logo

Comments (7)

jamescryer avatar jamescryer commented on June 2, 2024

It should work on Windows. I built it on Windows.. Just had a quick gander, no repro for me with the demo :(

Can't say for sure, you seem to be using a npm installed CasperJS 'C:/Users/Kriss/AppData/Roaming/npm/node_modules/casperjs/modules/casper.js:1553' which is reasonable - but I wonder if the version you're using is different in some way, perhaps there has been a breaking change in CasperJS recently.

Could you try using (Windows only) the casperjs.bat file?

casperjs.bat test demo/testsuite.js

from phantomcss.

voodoochild avatar voodoochild commented on June 2, 2024

I get the same error when I invoke the demo test suite with casperjs.bat. Is there an alternate way to install CasperJS that you think I should try?

from phantomcss.

jamescryer avatar jamescryer commented on June 2, 2024

Not sure it's the CasperJS install then. I can't think of any other possible solutions, maybe some weird localhost port conflict? Try running the demo tests without localhost running. Pulling at straws tbh. Sorry I can't be more helpful.

from phantomcss.

smrq avatar smrq commented on June 2, 2024

I'm running into this issue. It's extremely strange and exceedingly hard to reproduce. Probably not a PhantomCSS bug, but I really have no idea at this point. I'm posting less to ask for a solution and more to document my descent into madness.

Using:

  • casperjs 1.1.0-beta3 (via npm)
  • phantomjs 1.9.17 (via dependency of casperjs)
  • phantomcss 0.10.1 (via npm)

What's going on is that for some reason, Casper.prototype.fill seems to be getting clobbered by some other value, which can change depending on completely unrelated alterations to other parts of my test suite. Because of this, I'm starting to suspect some sort of memory allocation bug.

I've been looking for exactly where this happens, and I tracked it to this call within casper.captureSelector. Note the console.logs:

Casper.prototype.getElementBounds = function getElementBounds(selector) {
    "use strict";
    this.checkStarted();
    if (!this.exists(selector)) {
        throw new CasperError("No element matching selector found: " + selector);
    }
    var clipRect = this.callUtils("getElementBounds", selector);
console.log('getelementbounds1', Casper.prototype.fill);
    if (!utils.isClipRect(clipRect)) {
        throw new CasperError('Could not fetch boundaries for element matching selector: ' + selector);
    }
console.log('getelementbounds2', Casper.prototype.fill);
    return clipRect;
};

The output is as follows:

getelementbounds1 function GET(formSelector, vals, submit) {
    "use strict";
    return this.fillForm(formSelector, vals, {
        submit: submit,
        selectorType: 'names'
    });
}
getelementbounds2 984

A couple interesting things here. First is that at some point earlier, the function name has been replaced with what appears to be an HTTP verb. Second is that after utils.isClipRect is called, the value on Casper.prototype is replaced entirely with 984, which is the width of the element.

All of this leads to my preliminary hypothesis that for some reason, the section of memory in which Casper.prototype resides has somehow been double-allocated.

That's all I've got for now.

from phantomcss.

smrq avatar smrq commented on June 2, 2024

Note that I tried the same repo on Windows and OSX, and only ran into this issue on the Windows machine.

from phantomcss.

smrq avatar smrq commented on June 2, 2024

I have a minimal reproducing test case: https://github.com/smrq/phantomcss-wtf

from phantomcss.

raveclassic avatar raveclassic commented on June 2, 2024

I've run into this issue and after some research found a quickfix: https://groups.google.com/forum/#!topic/casperjs/i39TtMnwgJs
Seems like casperjs issue with casper.fill on windows.

I've created a pull-request with a fix: #127

from phantomcss.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.