Skip to content
Scott Plumlee edited this page Jun 18, 2013 · 10 revisions

The config file is a Node.js module which defines variables used to configure a Queen Server instance.

Queen will load the config file if it's passed in as a file path, and it'll attempt to find a "queenConfig.js" file in the current directory automatically if no file path is provided through the command line. Any command line options override options set in a config file.

// Example of running Queen with a config file
queen my-config-file.js

// If the config file name is "queenConfig.js" you don't need to
// provide the name
queen

// Command line arguments override config options, in this case, Queen will start
// with verbose logging regardless of what the config file says
queen -v my-config.file.js

Options

host port 9200 on all hosts by default

The host to bind the remote server to. This is the address queen-remote clients will connect to.

// Sample queenConfig.js file
// Starts queen, listening to port 9283 on host queen.turn.com for 
// remote connections (assumes queen.turn.com points to this machine
module.exports = {
    host: "queen.turn.com:9283"
};

capture [Internal IP Address]:80 by default

The address to bind the capture server to. Browsers will navigate to the url + "/capture.html" to connect to Queen.

// Sample queenConfig.js file
// Starts queen, listening to port 4848 on localhost for browsers. This would allow
// browsers to connect to this Queen Server by navigating to http://localhost:4848
module.exports = {
    capture: "localhost:4848"
};

remote Disabled by default

Allows you to connect to a another Queen server to execute code. Setting this option disables the host and capture variable, since one Queen instance can't act both as a client and a server at the same time.

If the machine you're using this command on doesn't need to start it's own Queen Server, use queen-remote instead, it does the same thing for a fraction of the package size (250 KB instead of 18 MB).

// Sample queenConfig.js file
// Connects to a Queen server running on queen.turn.com, port 9200 and 
// executes the script at http://queenjs.com/server-example.js
module.exports = {
    remote: "queen.turn.com:9200",
    script: "http://queenjs.com/server-example.js"
};

script

A server-side Queen script to run when Queen initializes.

// Sample queenConfig.js file
// Starts a Queen server with default options and
// executes the script at http://queenjs.com/server-example.js
module.exports = {
    script: "http://queenjs.com/server-example.js"
};

populator

An array of automatic populators to use, or a single populator. Queen support auto population from Selenium Grid, SauceLabs, and BrowserStack. If you're using a cloud service, you need to enable tunneling in order for the browsers to connect to Queen.

// Sample queenConfig.js file
// If the items in brackets are filled with valid values, the Queen server 
// will automatically connect to the Selenium Grid to spawn a Firefox browsers,
// and to the Sauce Labs cloud to spawn an iPad browser, and to Browser Stack cloud
// to spawn another Firefox browser. It will then monitor these browsers, so that if
// they become unresponsive, it'll restart them automatically.
module.exports = {
    // populator can be an array with multiple objects
    // or a single object 
    populator : [
	{
		type: "selenium",
		config: {
			host: '[SELENIUM GRID HOST', 
			port: [SELENIUM GRID PORT]
		},
		clients: [
			{ browserName: "firefox" }
		]
	},
	{
		type: "sauce",
		config: {
			username: "[SAUCE USERNAME]",
			accessKey: "[SAUSE ACCESS KEY]"
		},
		clients: [ // Array of clients to auto populate
			{ 
				browserName: "ipad",
				platform: "Mac 10.8",
				version: "5.1"
			}
		]
	},
	{
		type: "browserstack",
		config: {
			username: "[BROWSER STACK USERNAME]",
			password: "[BROWSER STACK PASSWORD]",
			version: 2 // The api version to use
		},
		clients: [ // Array of clients to auto populate
			{ 
				browser: "firefox",
				version: "11.0",
				os: "win"
			}
		]
	}
    ]
};

verbose

Enable debug logging.

quiet

Supress logging.

heartbeatInterval

Milliseconds clients have to send a heartbeat until they're considered unresponsive.

Clone this wiki locally