Im trying to open firefox console through Selenium with Python. How can I open firefox console with python selenium? Is it possible to send keys to the driver or something like that?
Im trying to open firefox console through Selenium with Python. How can I open firefox console with python selenium? Is it possible to send keys to the driver or something like that?
I know this is relatively old but I ran into this issue recently. I got firefox to automatically open devtools by passing in a browser process argument "-devtools".
Selenium: 3.14 geckodriver: 0.21.0 firefox: 61.0.1
from __future__ import print_functionfrom datetime import datetimeimport loggingimport osfrom selenium import webdriverfrom selenium.webdriver.firefox.options import Options as FirefoxOptionsdef before_scenario(context, scenario):logging.info("RUNNING: " + scenario.name)print("Browser Test starting.\n")options = FirefoxOptions()options.log.level = "trace"options.add_argument("-devtools")if 'headless' in os.environ and os.environ['headless'] == '1':options.headless = Truecontext.driver = webdriver.Firefox(firefox_options=options)context.driver.maximize_window()