Hello everybody,

As you realized, we started exploring Selenium 4. Here’s the first article that we have. After our first article, I wanted to take a look at the Selenium Grid version 4. There are many changes coming with Selenium Grid. Concept, commands, URLs and many more things have changed.

There are three ways to run Selenium Grid

  • Standalone
  • Classical Grid (Hub and node)
  • Fully Distributed (Session, Distributor etc)

I am going to show you how to run a Standalone Selenium Grid and run a test on it.

From now on, when you execute your selenium standalone.jar file, it detects which drivers you have in your system. That’s why you need to place all the executable into your PATH.

Run Selenium Grid 4

Let’s add our first driver (chrome driver) into a folder. Then add this folder to the computer’s PATH and run the below command. If you don’t place Chrome or Firefox drivers in a folder you will not be able to execute test on those browsers

You will see an output like below. As you can see Chrome Driver is registered into our Grid.

Then navigate to http://localhost:4444/status

You will see your driver registered with 5 instances. Safari driver is automatically registered as I am using a MacBook.

You can add Gecko Driver in the same folder with Chrome Driver. Then you can check if it’s registered to Grid or not. Now my output should be like below.

Run a Test

Now, you can implement your first test. You just need to point your RemoveWebDriver to http://localhost:4444/ instead of http://localhost:4444/wd/hub which is the relevant URL for Selenium Grid 2.

After the execution, if you navigate to http://localhost:4444/status you’ll be able to see the session details.

You can find the related codes in our Github Account https://github.com/swtestacademy/Selenium4

Happy Testing!