Quality Testing

Quality is delighting customers

How to make Firefox headless in unittest(Python+selenium) framework?

How to make Firefox headless in unittest(Python+selenium) framework?

Views: 4

Reply to This

Replies to This Discussion

You can set the headless property through Options() class as I did in the code below. Also, almost every top outsource qa 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 Options


options = 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()

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

¬© 2021   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service