I'm new to CasperJs, going through quickstart and this code works for me:
var casper = require('casper').create();
casper.start('http://casperjs.org/', function() {
this.echo(this.getTitle());
});
casper.thenOpen('http://phantomjs.org', function() {
this.echo(this.getTitle());
});
casper.run();
But for certain webpages (https://www.seznam.cz, https://www.slever.cz) i got only empty title/screenshot/whatever
I execute script like this:
casperjs --ignore-ssl-errors=true hello.js
and with option --debug there is no clue what's wrong. I was trying to execute the script like this:
casperjs --ignore-ssl-errors=true --ssl-protocol=any hello.js
but with same result.
I'm using CasperJs 1.0.4 and PhantomJs 2.0 on Mac OS X.
Thanks for any advices
EDIT: I've downloaded beta version of casperjs and everything works fine now :)
Related
I'm relatively new to meteor, but have already some experience in AngularJS.
Now I have installed with the command npm install -g generator-angular-meteor the "angular-meteor-generator".
It works so far everything, but once the app starts, I get the error message
client/components/toolbar/toolbar.view.ng.html - HTML template does not exists!
My folder structure looks like this:
and my toolbar-directive:
'use strict'
angular.module('smashoArtikelVerwaltungApp')
.directive('toolbar', function() {
return {
restrict: 'AE',
templateUrl: 'client/components/toolbar/toolbar.view.ng.html',
replace: true
};
});
I have not made any changes of the generated code. What can i do?
After trying a long time to fix the problem, I came up with the following solution:
Downgrade the meteror version :
curl https://install.meteor.com/ | sed 's/1.4.0.1/1.3.3.1/' | sh
Simple, fast, but not elegant.
I've made a local file (log.html) in Firefox profile and tried to open it in an add-on page (add-on folder/data/log.html and it's shown as Resource protocol in URL bar).
self.port && self.port.on('add-log-path', function(payLoad) {
addLogPath(payLoad);
});
function addLogPath(url) {
// url == "file:///Users/usr/Library/Application Support/Firefox/Profiles/05rhodfg.cfxo/log.html"
$('#logpath').attr('href', url);
}
I've also tried changing that to JS method window.open
function addLogPath(url) {
$('#logpath').on("click", function() {
window.open(url);
});
}
But the error is
JavaScript error: , line 0: Error: Access to
'file:///Users/usr/Library/Application%20Support/Firefox/Profiles/05rhodfg.cfxo/log.html'
from script denied
BTW, before Firefox version 41, it has no problem doing this.
Can you suggest other workaround to solve this? Thank you!
edit:
added add-on example to reproduce the problem
download and run the following statement in Terminal:
$ cd fileProtocolExample && cfx run
Do self.data.url('filename_here') to get that path to your file.
It will look something like resource://your-extension-id/data/filename_here, then this should load fine. That resource:// in front is important, make sure you get and use that URL.
The file:// won't work, because your addon is packed in a zip. Its not extracted into the system. How did it work in Firefox 41? Was your addon unpacked at that time? This is an Addon-SDK addon right?
I have a VERY simple test site where I'm trying to experiment with the Livingstyleguide gem (https://github.com/livingstyleguide/livingstyleguide).
The problem is that when I run livingstyleguide compile my_src_file.lsg my_dest_file.html from the command line, the process hangs and the task is never carried out. There are no errors logged to the terminal window, so I'm not sure how to even start debugging this.
I've tried implementing livingstyleguide via Gulp as well, and running my task to create the style guide also fails from there. That DOES output an error, the details of which are as follows:
Error in plugin 'gulp-livingstyleguide'
Message:
Command failed:
Details:
killed: false
code: 10
signal: null
This is pretty cryptic, so I'm still not even sure what's failing.
Here's my gulpfile:
var gulp = require('gulp');
var sass = require('gulp-sass');
var livingstyleguide = require('gulp-livingstyleguide');
gulp.task('sass', function(){
return gulp.src('scss/*.scss')
.pipe(sass())
.pipe(gulp.dest('app/css'));
});
gulp.task('watch', function(){
gulp.watch('scss/*.scss', ['sass']);
});
gulp.task('lsg', function(){
gulp.src('scss/styleguide.html.lsg')
.pipe(livingstyleguide())
.pipe(gulp.dest('app'));
});
If I comment out the livingstyleguide() line in my gulpfile, the lsg task takes the src file and outputs it into the app directory, so I know that the paths to the files are correct, and it's just something with the plugin or permissions or something that's causing everything to fail.
Any help would be very, very appreciated!
I wrote a few tests with casperjs. They run just fine with phantomjs. However, when I tried to use slimerjs with the following command:
casperjs --verbose --engine=slimerjs test create-project-suite.js
A small window appers with the SlimerJs logo and version number but the console seems to hang with the following line:
Test file: create-project-suite.js
Is there anything else I need to do? Here are the version numbers:
Mozilla Firefox 28.0
CasperJS version 1.1.0-beta3
Innophi SlimerJS 0.9.1
3.8.0-37-generic #53~precise1-Ubuntu
Update:
I removed code until I got slimerjs to open the browser and execute tests. It seems that it hangs whenever I require a js file (I'm following the page objects pattern):
var Login = require('./objects/login');
I think require.paths could be helpful. Any ideas on how to get around this?
Using full paths makes slimerjs happy:
var path = fs.absolute(fs.workingDirectory + '/objects/login');
var Login = require(path);
It is plain simpler to move all modules to the same directory where the script is.
I tried your command and it works for me, maybe in your file you use an instruction specific to phantom :
http://docs.slimerjs.org/0.8/differences-with-phantomjs.html
But it should open the window(at least the start() ).
Anyway the command is fine.
How to open download window using vimperator in firefox. Is there any key map to view current downloads?
you can use the command :downloads
There is a command :downloads, but it is not working right now. This bug will be fixed in the next version of Vimperator (current version is 3.8.1).
In the meantime you can add the following to your .vimperatorrc (which, basically, does exactly the same as the patch applied to the official Vimperator tree)):
js <<EOF
commands._exCommands = commands._exCommands.filter(function (cmd) !cmd.hasName("downloads"));
commands.add(["downl[oads]", "dl"],
"Show progress of current downloads (fixed)",
function () {
liberator.open("chrome://browser/content/downloads/contentAreaDownloadsView.xul",
{ from: "downloads"});
},
{ argCount: "0" },
true);
EOF
(don't forget to restart Firefox or source ~/.vimperatorrc)