Quality is delighting customers
Please help me in making Firefox headless in unittest(Python+selenium) framework.
Tags:
You can set the headless property through Options() class as I did in the code below. Also, almost every software testing solutions team uses similar or same code to run Firefox headless in the unittest framework(python + selenium):
from selenium import webdriver
from selenium.webdriver.firefox.options import Optionsoptions = Options()
options.headless = True
driver = webdriver.Firefox(options=options, executable_path=r'C:\Utility\BrowserDrivers\geckodriver.exe')
driver.get("http://google.com/")
print ("Headless Firefox Initialized")
driver.quit()
© 2021 Created by Quality Testing.
Powered by