How to setup SlimerJS with CasperJS on Windows?

3.3k views Asked by At

I put casperjs and slimerjs on a folder in my Desktop.

I add these folders in my PATH.

  • C:\Users\User1\Desktop\Bins\casperjs
  • C:\Users\User1\Desktop\Bins\slimerjs-0.9.0

I set a new user variable SLIMERJSLAUNCHER with this as value:

C:\Users\User1\Desktop\Bins\slimerjs-0.9.0\xulrunner\xulrunner.exe

But when I launch a script like that:

casperjs --engine=slimerjs test.js

I have a message box with:

Error: couldn't parse application.ini

What's wrong with my setup?

1

There are 1 answers

0
Fanch On

I don't know for xulrunner but if you have firefox, just as said in the readme.md -slimerjs package-,

  • Download the Lightweight Edition, set a system variable SLIMERJSLAUNCHER = C:\Program Files (x86)\Mozilla Firefox\firefox.exe
  • and then your test file and the slimerjs files have to be in the same folder (i mean the package downloaded have to be where you execute your main tests, we execute a batch file -.bat-, not an .exe file) or see that: What is the correct way to launch slimerjs in casperjs (with an absolute path)? for more details.
  • shift+right clic in this folder -> open a new command : $ casperjs test test.js --engine=slimerjs (i'm speaking about testing because i use it mainly for that)

And you should be able to launch your casperjs files (in slimerjs or phantomjs by specify the engine).

Warning : if you want to execute your whole suite like that : - casperjs test mainTests/ --pre=pre.js --includes=inc.js --post=post.js --engine=slimerjs --xunit=parsetest.xml(use inc.js to factorize some useful functions, like login...)

You will have an error : "getMozFile : The path is not an absolute path".

So do that : - casperjs test ./mainTests/ --pre=pre.js --includes=inc.js --post=post.js --engine=slimerjs --xunit=parsetest.xml

(the folder mainTests contains all my tests). It works for me, don't know if it's helpful.

Or you go in your folder with the slimer package and you specify the whole path of your test file/folder -> casperjs test c:/path/to/test.js