# Marionette, Act II: Harnessing automation to test the browser

DevFeed: [Marionette, Act II: Harnessing automation to test the browser](<https://devfeed.tech/articles/marionette-act-ii-harnessing-automation-to-test-the-browser-20246.md>)

Original publisher: [Read original article](<http://anjana.dev/blog/marionette-act-ii-testing/>)

Author: Anjana Sofia Vakil (contact@anjana.dev)

Published: 2016-08-22T00:00:00Z

Content type: tutorial

Language: en

Sources: [Mozilla Automation](<https://devfeed.tech/sources/mozilla-automation.md>)

Topics: [Browser Automation](<https://devfeed.tech/topics/browser-automation.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Firefox](<https://devfeed.tech/topics/firefox.md>), [Mozilla](<https://devfeed.tech/topics/mozilla.md>), [Python](<https://devfeed.tech/topics/python.md>), [API](<https://devfeed.tech/topics/api.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [automation](<https://devfeed.tech/tags/automation.md>), [browser](<https://devfeed.tech/tags/browser.md>), [firefox](<https://devfeed.tech/tags/firefox.md>), [marionette](<https://devfeed.tech/tags/marionette.md>), [mozilla](<https://devfeed.tech/tags/mozilla.md>), [python](<https://devfeed.tech/tags/python.md>), [test](<https://devfeed.tech/tags/test.md>)

## AI overview

This article explains the Marionette test harness, a testing framework for running automated tests on Mozilla browsers using the Marionette automation tools. It describes how browser automation supports testing instead of manual checks, with a Python API controlling the Gecko browser engine.

## Source excerpt

Welcome back to my post series on the Marionette project! In Act I, we looked into Marionette's automation framework for Gecko, the engine behind the Firefox browser. Here in Act II, we'll take a look at a complementary side of the Marionette project: the testing framework that helps us run tests using our Marionette-animated browser, aka the Marionette test harness. If - like me at the start of my Outreachy internship - you're clueless about test harnesses, or the Marionette harness in particular, and want to fix that, you're in the right place! Wait, what's Marionette again? Quick recap from Act I: Marionette refers to a suite of tools for automated testing of Mozilla browsers. In that post, we saw how the Marionette automation framework lets us control the Gecko browser engine (our "puppet"), thanks to a server component built into Gecko (the puppet's "strings") and a client component (a "handle" for the puppeteer) that gives us a simple Python API to talk to the server and thus control the browser. But why do we need to automate the browser in the first place? What good does it do us? Well, one thing it's great for is testing. Indulge me in a brief return to my puppet metaphor from last time, won't you? If the automation side of Marionette gives us strings and a handle that turn the browser into our puppet, the testing side of Marionette gives that puppet a reason for being, by letting it perform: it sets up a stage for the puppet to dance on, tell it to carry out a given performance, write a review of that performance, and tear down the stage again. OK, OK, metaphor-indulgence over; let's get real. Wait, why do we need automated browser testing again? As Firefox1 contributors, we don't want to have to manually open up Firefox, click around, and check that everything works every time we change a line of code. We're developers, we're lazy! Clueless via POPSUGAR But we can't not do it, because then we might not realize that we've broken the entire internet (or, yo