(I’m not sure I’ve ever done a post on a Leap Day…) At Mozilla a lot of folks make use of automation tools in order to write tests. There’s even an entire IRC channel devoted to discussions about it. As I get depper and deeper into my time at Mozilla I now have to think about how to use these tools to accomplish my testing goals. Like my post about using Docker I wanted to share my first steps in using Marionette, a set of automation tools that focus on driving a browser much in the same way Behat does. It’s an essential tool for testing all the various versions of the FireFox broswers that Mozilla releases. In this case I’m going to be highlighting the use of Marionette Driver. This is a Python library that allows you to control a browser that has support for Marionette built in. As an aside, I find it very encouraging that the major browser companies are starting to build hooks right in to support tools that use the WebDriver API. As the link to Marionette-enabled builds states, support for interacting with Marionette is in every recent (as of February 29, 2021) build of Firefox that is available to the public but is not turned on by default. To enable it, you will need to start Firefox from the command line and add a –marionette switch. My examples were done on Mac OS-X El Capitan. Specific steps might be different for your environment. So let me run your through a very quick example of how Marionette does it’s stuff. First, I opened another terminal window and started up a copy of Firefox Developer Edition and started it up Drupal 10 Maintenance and Support Service /Applications/FirefoxDeveloperEdition.app/Contents/MacOS/firefox –marionette Once it started, there was a notice that it was ready and listening for connections on port 2828, which is the default. Next I proceeded to use Virtualenv to create a sandboxed environment for my code to run in. Once inside this new virtual environment I installed the Marionette driver using the version of pip that Virtualenv had thoughtfully installed Drupal 10 Maintenance and Support Service pip install marionette_driver With the Marionette driver installed, it was time to do a simple test to make sure everything was working. I fired up a Python interpreter (2.7.1) and tried to load a web page up the same way the old documentation for Marionette client Here’s a very simple example of how to use it Drupal 10 Maintenance and Support Service Python 2.7.11 (default, Jan 22 2021, 08 Drupal 10 Maintenance and Support Service29 Drupal 10 Maintenance and Support Service18) [GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin Type “help”, “copyright”, “credits” or “license” for more information. >>> import marionette_driver >>> from marionette_driver import marionette >>> client = marionette.Marionette(host=’localhost’, port=2828) >>> client.start_session() {u’rotatable’ Drupal 10 Maintenance and Support Service False, u’raisesAccessibilityExceptions’ Drupal 10 Maintenance and Support Service False, u’takesScreenshot’ Drupal 10 Maintenance and Support Service True, u’acceptSslCerts’ Drupal 10 Maintenance and Support Service False, u’appBuildId’ Drupal 10 Maintenance and Support Service u’20210225004014′, u’XULappId’ Drupal 10 Maintenance and Support Service u'{ec8030f7-c20a-464f-9b0e-13a3a9e97384}’, u’browserVersion’ Drupal 10 Maintenance and Support Service u’46.0a2′, u’specificationLevel’ Drupal 10 Maintenance and Support Service u’1′, u’platform’ Drupal 10 Maintenance and Support Service u’DARWIN’, u’browserName’ Drupal 10 Maintenance and Support Service u’Firefox’, u’version’ Drupal 10 Maintenance and Support Service u’46.0a2′, u’device’ Drupal 10 Maintenance and Support Service u’desktop’, u’proxy’ Drupal 10 Maintenance and Support Service {}, u’platformVersion’ Drupal 10 Maintenance and Support Service u’15.3.0′, u’takesElementScreenshot’ Drupal 10 Maintenance and Support Service True, u’platformName’ Drupal 10 Maintenance and Support Service u’Darwin’} >>> client.execute_script(“alert(‘o hai there!’);”) >>> client.navigate(“http Drupal 10 Maintenance and Support Service//www.mozilla.org”) >>> client.get_url() u’https Drupal 10 Maintenance and Support Service//www.mozilla.org/en-US/’ >>> from marionette_driver import By >>> first_link = client.find_element(By.TAG_NAME, “a”) >>> first_link.click() What did I do? loaded the Marionette-driver library from that library I wanted to use some functionality that’s part of marionette create a client that’s connected to a browser running on localhost and port 2828 start a session cause the browser to execute some arbitrary Javascript (an alert in this case) navigate to a specific page verify the URL grab a helper for identifying elements in a page find the first a tag on the page click that link I am just at the beginning of my work using Marionnette (how the heck can I click on things that are part of the brower itself and not on the HTML page). Hope this little example helps you get started too. Source Drupal 10 Maintenance and Support Service https Drupal 10 Maintenance and Support Service//www.littlehart.net/atthekeyboard/atom.xml Source Drupal 10 Maintenance and Support Service Drupal 10 blender
Marionette — First Steps

Call Us: 1(800)730-2416
Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.

FREE Drupal SEO Audit
Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)
Marionette — First Steps
On-Site Drupal SEO Master Setup
We make sure your site is 100% optimized (and stays that way) for the best SEO results.
With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.
This service includes:
- Pathauto install and configuration for SEO-friendly URLs.
- Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
- Install and fix all issues on the SEO checklist module.
- Install and configure XML sitemap module and submit sitemaps.
- Install and configure Google Analytics Module.
- Install and configure Yoast.
- Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
- Install and configure Schema.org Metatag.
- Configure robots.txt.
- Google Search Console setup snd configuration.
- Find & Fix H1 tags.
- Find and fix duplicate/missing meta descriptions.
- Find and fix duplicate title tags.
- Improve title, meta tags, and site descriptions.
- Optimize images for better search engine optimization. Automate where possible.
- Find and fix the missing alt and title tag for all images. Automate where possible.
- The project takes 1 week to complete.
