I have a page with a frame in it. the frame is loaded from the same (currently: localhost) server. however, after the frame is loaded, the page suppose to load a content into that frame (happens in every browser) but it is not happening in casper.
I'll list it in simple steps:
- Page loading
- Frame loading
- page loading content into the frame
This last step, step 3 is what missing. waiting for 5 seconds didn't help, every screen capture is coming back empty where the frame is.
I've used withFrame
method, and I did get the frame, but it won't fill (got the loaded code, not the full code that appears after in every browser).
After using error checking, it seems that casper does not recognize the bind()
method.
I've tried to inject a bind prototype like so:
if (!Function.prototype.bind)
{
console.log('bind injecttor 1');
Function.prototype.bind = function (oThis)
{
console.log('bind injecttor 2');
if (typeof this !== "function")
{
console.log('bind injecttor error');
// closest thing possible to the ECMAScript 5 internal IsCallable function
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
}
var aArgs = Array.prototype.slice.call(arguments, 1),
fToBind = this,
fNOP = function ()
{
},
fBound = function ()
{
return fToBind.apply(this instanceof fNOP && oThis
? this
: oThis,
aArgs.concat(Array.prototype.slice.call(arguments)));
};
fNOP.prototype = this.prototype;
fBound.prototype = new fNOP();
console.log('bind injected.');
return fBound;
};
}
Now, I got the first log, but none of the others. any ideas?