All Posts

What is Selenium Event Bus?

What is Selenium Event Bus?

In this tutorial, we will learn about Selenium Event Bus. The steps involved to start the Selenium Grid Component.

Selenium Event Bus

Selenium Event Bus is a grid component in the new Selenium 4 Grid architecture. The component is the communication platform for other components to interact with each other seamlessly. The components interact with each other with messages.

It acts like a central messaging system. Instead of Grid components communicating directly with one another, they publish and subscribe to events through the Event Bus.

For example, when a new browser session is created, components can exchange events to coordinate the process.

This component should be the first component that should be started in the Selenium Grid Distributed mode.

 

Selenium 4 Grid Components

Why is Event Bus required?

Selenium Grid consists of multiple components, such as Router, Distributor, Session Queue, Session Map, and Nodes. These components need to communicate to manage browser sessions.

The Event Bus helps by:

  • Sending messages between Grid components.

  • Supporting event-based communication.

  • Reducing direct dependencies between components.

  • Helping coordinate browser session creation and management.

     

How does Selenium Event Bus work?

Consider a scenario where a new Selenium Node joins the Grid.

  1. Node: Sends a registration event to the Event Bus.

  2. Event Bus: Receives the event and makes it available to interested components.

  3. Distributor: Receives the registration event and verifies the Node through an HTTP request.

  4. Distributor: Registers the Node and updates its Grid Model.

The Event Bus also helps other Grid components exchange asynchronous events related to session management

How to start?

  • Download Selenium Server
  • Launch Command Prompt
  • Issue the following command:

\> java -jar <selenium-server-4.x_ jar> event-bus

Command updated with theĀ  latest 4 release candidate version:

Selenium Event Bus