def set_driver(d):
  """Set the Selenium driver to use
  
  Arguments:
  d -- driver string (firefox | chrome)
  """
  global driver
  
  d = d.lower()
  supported_drivers = ['firefox', 'chrome']
  if d not in supported_drivers:
    raise Exception(
      'Invalid driver. Supported: %s' % ', '.join(supported_drivers)
    )
  
  driver = d
  
  return True