Skip to content

Files

Latest commit

efe2787 · Sep 25, 2014

History

History
This branch is 522 commits behind laurentj/slimerjs:master.

src

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Aug 19, 2014
Aug 25, 2014
Oct 2, 2013
Mar 18, 2014
Sep 25, 2014
Aug 16, 2013
Aug 7, 2014
Jul 31, 2013
Aug 25, 2014
Aug 7, 2014
Nov 3, 2013
Jun 25, 2014
Jun 13, 2014
Jun 13, 2014

SlimerJS

SlimerJS is a scriptable browser. It allows you to manipulate a web page with a Javascript script: opening a webpage, clicking on links, modifying the content... It is useful to do functional tests, page automaton, network monitoring, screen capture etc.

Go to [http://slimerjs.org] to know more and to access to the documentation

Install

  • Install Firefox, or XulRunner (both version 18 or more)
  • Download the latest package or the source code of SlimerJS if you didn't it yet
  • On windows, a .bat is provided, but you can also launch slimer from a "true" console. In this case, you should install Cygwin or any other unix environment to launch slimerjs.
  • SlimerJS needs to know where Firefox or XulRunner is stored. It tries to discover itself the path but can fail. You must then set the environment variable SLIMERJSLAUNCHER, which should contain the full path to the firefox binary:
    • On linux: export SLIMERJSLAUNCHER=/usr/bin/firefox
    • on Windows: SET SLIMERJSLAUNCHER="c:\Program Files\Mozilla Firefox\firefox.exe
    • On windows with cygwin : export SLIMERJSLAUNCHER="/cygdrive/c/program files/mozilla firefox/firefox.exe"
    • On MacOS: export SLIMERJSLAUNCHER=/Applications/Firefox.app/Contents/MacOS/firefox
  • You can of course set this variable in your .bashrc, .profile or in the computer properties on Windows.

Launching SlimerJS

Open a terminal and go to the directory of SlimerJS (src/ if you downloaded the source code). Then launch:

    ./slimerjs myscript.js

In the Windows commands console:

    slimerjs.bat myscript.js

The given script myscripts.js is then executed in a window. If your script is short, you probably won't see this window.

You can for example launch some tests if you execute SlimerJS from the source code:

    ./slimerjs ../test/initial-tests.js

Launching a headless SlimerJS

There is a tool called xvfb, available on Linux and MacOS. It allows to launch any "graphical" programs without the need of X-Windows environment. Windows of the application won't be shown and will be drawn only in memory.

Install it from your prefered repository (sudo apt-get install xvfb with debian/ubuntu).

Then launch SlimerJS like this:

    xvfb-run ./slimerjs myscript.js

You won't see any windows. If you have any problems with xvfb, see its documentation.

Getting help