title: How to write commands into the Firefox console using Selenium WebDriver with Java?
body: <p>I open Firefox console, using Selenium Webdriver.</p>
  
  <pre><code>@Test
  public void seleniumFirefoxConsole() {
      System.setProperty("webdriver.gecko.driver", "C:\\Users\\FirefoxDriver\\geckodriver.exe");
  
      FirefoxOptions options = new FirefoxOptions();
      options.addArguments("-console");
      WebDriver driver = new FirefoxDriver(options);
  
      driver.get("http://www.google.com");
    }
  </code></pre>
  
  <p>How can I write commands in this console using Java code like this:</p>
  
  <pre><code>console.log("Hello, Firefox console from selenium");
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/mvypJ.jpg" rel="nofollow noreferrer">Firefox opened console</a></p>