Quality Testing

Quality is delighting customers

Please help me in making Firefox headless in unittest(Python+selenium) framework.

Please help me in making Firefox headless in unittest(Python+selenium) framework.

Views: 16

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

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2021   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service