Selenium's headless mode allows running browser tests without a visible browser window by configuring the browser driver with the headless option. This approach enables faster and more efficient test execution as rendering the browser window is unnecessary.
Earlier to execute your Selenium tests in headless mode, you had to utilize the ChromeOptions as shown below.
ChromeOptions options = new ChromeOptions();
By using setHeadless() method, you will accomplish the same result.