Two Months in Selenium - November and December

January 21, 2018
selenium

You may have noticed a distinct lack of an update last month. It’s because I was focused on client work, Christmas, and the New Year, and took some time away from the keyboard. But I’m back now!

The W3C WebDriver spec is now at the stage where we need to demonstrate multiple compatible implementations. Realistically, this means that we need two passes for each test in our test suite. The browser vendors are working hard to get things working, and progress is being made. There’s not been a huge amount for me to do here, so this is more of a waiting game than anything else from my perspective. Having said that, I’m on the hook for some sections in Level 2, so I should really sit down and write those (and the matching tests)

The main thing I’ve been focused on has been the Selenium Grid. There are a couple of things that we really need to solve with Grid. The first is that the code is complex and hard to deal with. When we originally released it, it took a huge amount of work to review the code for thread-safety and to debug many of the issues. That code has not become easier to reason about, which makes it harder to foster Open Source contributions.

Of course, that’d be fine if we didn’t care about making any changes, but we do. When Grid came into being, it was normal to have a physical server for each node in the grid. If you were lucky, you might have a massive server with VMWare running on it, which you’d cycle virtual machines on to keep the Grid healthy. The world has changed. Docker is now A Thing, and there are multiple “Selenium as a Service” (SaaS) cloud providers.

There are some projects out there that implement some of the functionality of Grid. For example, selenoid makes use of Docker, but it doesn’t use the W3C dialect of the webdriver protocol, which means it doesn’t do protocol conversion, and it doesn’t natively support cloud providers. Zalenium builds on top of Grid, and provides support for Docker and SaaS, but they’ve had to work within the existing architecture, and there are obvious rough edges.

Finally, we’ve wanted the selenium server to be a “Grid of one”. If you go into the code of the server, you’ll see that there are two fairly separate trees that live side-by-side. When you start the server, it picks one and then goes with it. It’d made things like supporting the W3C protocol harder than it should be, and it’s not an elegant way to run things.

As a solution to this, it seems obvious that there should only be one code path. The problem is that the standalone server is too simplistic about how it assigns work, and (as discussed) the Grid code is too complex. Over the past few releases, I’ve been landing code to help resolve this:

The most recent thing I’ve been working on has been a new scheduler. This will be rolled into the new session pipeline, and is composed of a number of pieces:

The scheduler will sit within the new session pipeline. For the standalone server, we just add a single host. For the grid, we can add an arbitrary number of hosts (and therefore session factories)

As well as the new scheduler, we’re preparing the 3.9 release. It should be out next week, if everything goes according to plan. :)

More recently A Month in Selenium: February     The Selenium Server & Creating New Sessions Less recently

Many Months in Selenium: to November

November 26, 2018
selenium tech

A Month in Selenium: March

March 31, 2018
selenium tech

A Month in Selenium: February

March 13, 2018
selenium tech