title: How to read the web console output with robot framework and selenium?
body: <p>I am trying to read the console output of a webpage, especially I need the POST-GET-PUT ajax calls, with RF and Selenium. I have found some help online but I cannot seem to make it work. the python script I have is:</p>
  <pre><code>from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
  
  def get_logs2(driver):
  # enable browser logging
      #d = DesiredCapabilities.CHROME
      #d['goog:loggingPrefs'] = { 'browser':'ALL' }
      #driver = webdriver.Chrome(desired_capabilities=d)
  
      # load the desired webpage
      #driver.get(driver.current_url)
      a = driver.get_log('browser')
  
      # print messages
      for entry in driver.get_log('browser'):
          print(entry)
      print(&quot;finished&quot;)
      return a
  </code></pre>
  <p>I call this script from RF, after having done some operations on the webpage. So I need to pass to this function the page exactly how it is after the actions I took. To do that I do:</p>
  <pre><code>    ${seleniumlib}=    Get Library Instance    SeleniumLibrary
      Log    ${seleniumlib._drivers.active_drivers}[0]
      ${message} =    Get Logs2   ${seleniumlib._drivers.active_drivers}[0]
  </code></pre>
  <p>I get as a result and empty message, but I know console is not empty. Can you help? Thanks.</p>