How to hide Firefox window (Selenium WebDriver)?

前端 未结 14 961
执念已碎
执念已碎 2020-11-27 11:08

When I execute multiple test simultaneously, i don\'t want to keep Firefox browser window visible.. I can minimize it using selenium.minimizeWindow() but I don\

14条回答
  •  时光说笑
    2020-11-27 11:48

    just add these and it will work if you are using chrome, also useful in firefox

    from selenium.webdriver.chrome.options import Options
    '''option to make driver work background'''
    chrome_options = Options()
    chrome_options.add_argument('--headless')
    chrome_options.add_argument('--disable-gpu')
    

提交回复
热议问题