I have a script to verify that - when clicked - it generates an iFrame that loads the file. How can I intercept an answer using CasperJS?
I have already tried the sequence:
casper.click('element');
casper.withFrame('frame', function(){
console.log(this.getCurrentUrl());
console.log("content: " + this.getHTML());
this.on('resource.received', function(resource){
console.log(resource.url);
});
});
I need the contents of the file, but cannot create the URL without clicking the element or changing the script that I am testing.
Ideas?
source
share