A platform for running scripts on many browsers
Let's say you want to play a game where you write down a number and others try to
guess it. You gather some friends and tell them to start giving numbers at you.
Your friends keep giving you random numbers until one of them gets it right.
Now imagine your friends are browsers, and the game is a script which tells browsers
how to play, and waits for the right number to be guessed. This makes you the Queen Server.
The Queen Servers allows you to perform distributed tasks on many browsers -- a platform for
running scripts on many browsers.
Let's run the example:
- Install Node.js version 0.8 or higher
- In your terminal, run:
sudo npm install -g queen
queen -c localhost:9300 http://queenjs.com/server-example.js
- Click here and watch your terminal.
Here's what happened:
- You installed queen using a package manager that comes with Node.
- You asked queen to start capturing browsers on localhost port 9300 and run this server-side queen script.
- You pointed your browser to the queen server, allowing queen to push code that the server-side script requested to run on browsers (the "client-side script"). When this client-side script loaded, it started reporting back to the server-side script random number guesses. Once the server-side script saw the correct number, it ended the process.
It's not for guessing numbers
Queen is a server which captures browsers and then is able to push scripts to them to run in a clean context
(an iframe). Here are somethings it can do out of the box:
- Bidirectional communication between your client-side and server-side script (using socket.io).
- Run scripts on browsers connected to a central Queen server remotely using a thin-client (queen-remote).
- Connect browsers automatically using Selenium, BrowserStack, or SauceLabs.
- Automatically detects and recovers unresponsive browsers.
- Target browsers based on browser type/version, operating system, or capabilities (anything Modernizr can detect).
- Run scripts via command line, configuration file, or import Queen into your own project as a library.
- Can run lists of scripts or an HTML files.
- Monitoring of connected browsers and active jobs.
Queen is the foundation of Thrill, a test runner for web applications.
Rule your Browser Kingdom
Queen bears the Apache License 2.0. Read this to get starting on hacking queen. Your contributions are welcome at GitHub.