Can Selenium Webdriver run in the background?

Can Selenium Webdriver run in the background?

Selenium Webdriver can run in the background, i.e. without opening a browser window, by running it in Headless mode. To do this you need to add the required capability to the set-up code for the driver. In Python with Chromedriver you need to add the following line of code when writing the chrome_options:

chrome_options.add_argument("--headless")

Headless mode is available to most other browser/language combinations too.

Leave a reply

Your email address will not be published. Required fields are marked*

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.