You write tests on your laptop. They do their real job on a build server: a machine that runs the whole suite automatically whenever someone changes the code. Most teams call this CI.
Three things change there.
There is no screen. The build server has no display, so the browser must run in headless mode, which means without a visible window:
const options = new chrome.Options();
options.addArguments('--headless=new', '--no-sandbox', '--disable-dev-shm-usage');
driver = await new Builder().forBrowser('chrome').setChromeOptions(options).build();
Those last two arguments look mysterious, and you will copy them from Stack Overflow like everyone else. They stop Chrome from crashing inside a container, which is where most build servers run.
The machine is slower. Tests that quietly relied on your fast laptop start failing. That is the server finding timing assumptions you did not know you had.
Nobody is watching. Save screenshots on failure, as in the last lecture, and store them where your team can open them.
Now, Selenium Grid. Grid is a tool that runs your tests on other machines. You send tests to a central point, and it distributes them to computers that have the browsers installed.
Teams use Grid for two reasons: to run many tests at the same time, and to reach browsers they do not have locally, like Safari on macOS from a Linux server.
Here is the honest advice, because juniors are often asked to set up Grid too early. Do not build your own Grid until you actually need it. Running and maintaining those machines is real work. If you need parallel runs, most build servers can already split a suite across containers. If you need many browsers and devices, a paid cloud service is usually cheaper than the days you would spend maintaining your own.
Finally, the thing that matters more than any infrastructure: a slow or flaky suite becomes useless. If the suite takes forty minutes, developers stop waiting for it. If a test fails at random, they learn to re-run red builds without looking.
I have seen this finish badly. A payment bug reached production on a Friday afternoon. The build had caught it. Three people re-ran that build without opening the report, because everyone had learned that red usually meant nothing.
Remember this: run headless in CI, save evidence on failure, and only add Grid when you can name the problem it solves.
Reference: Selenium Grid.