If this sounds similar to Selenium/WebDriver then you're correct! Marionette shares much of the same ethos and API as Selenium/WebDriver, with additional commands to interact with Gecko's chrome interface. Its goal is to replicate what Selenium does for web content: to enable the tester to have the ability to send commands to remotely control a user agent.
How does it work?
Marionette consists of two parts: A server which takes requests and executes them in Gecko, and a client. The client sends commands to the server and the server executes the command inside the browser.
When would I use it?
If you want to perform UI tests with browser chrome or content, Marionette is the tool you're looking for! You can use it to control either web content, or Firefox/B2G itself.
A test engineer would typically import the Marionette client package into their test framework, import the classes and use the class functions and methods to control the browser. After controlling the browser, Marionette can be used to return information the state of the browser which can then be used to validate that the action was performed correctly.
Marionette combines a gecko component (the Marionette server) with an outside component (the Marionette client), which drives the tests. Marionette ships with Firefox and Firefox OS, and to use it you will need to download a Marionette client or use the in-tree client.
- Using Marionette via WebDriver
- Get a Build – Instructions on how to get a Marionette-enabled build of Firefox, Firefox OS or desktop Firefox OS
- Download and setup the Marionette Python client
- Download and setup the Marionette JS client
- Connecting to Marionette on a B2G device or emulator
- Run Tests with Python – How to run tests using the Python client
- You might want to experiment with using Marionette interactively at a Python command prompt
- Start writing and running tests with supported test frameworks!
- Debugging server code using the Browser Toolbox
Please file any bugs you may find in the Testing :: Marionette component in Bugzilla. You can view a list of current bugs to see if your problem is already being addressed.
Feel free to drop us a line over at the #ateam channel!
If you're interested in contributing, please follow this setup guide!
Subpages (temporary section)
This section is here to help with copy-editing and organization work that is ongoing, and will be removed sometime soon once that work is done.