input: Write a function to create a Selenium script in Python that automates the login process on the given website. The function should return the status of the login attempt with 'Login successful!' if the login is successful, or an error message if there is an issue.
  assert automate_login('http://www.example.com', 'username', 'password')=='Login successful!'
  assert automate_login('http://www.invalid.com', 'user', 'pass')=='ERROR: Unable to load page'
  assert automate_login('http://www.example.com', 'wronguser', 'wrongpass')=='ERROR: Login failed'
output: def automate_login(url, username, password):
      from selenium import webdriver
      from selenium.webdriver.common.by import By
      from selenium.webdriver.common.keys import Keys
      from selenium.webdriver.chrome.service import Service
      from selenium.common.exceptions import WebDriverException
      import time
  
      try:
          driver = webdriver.Chrome(service=Service())
          driver.get(url)
          time.sleep(2)
      except WebDriverException:
          return 'ERROR: Unable to load page'
  
      try:
          username_field = driver.find_element(By.ID, 'username')
          password_field = driver.find_element(By.ID, 'password')
          login_button = driver.find_element(By.ID, 'loginButton')
      except Exception:
          driver.quit()
          return 'ERROR: Login failed'
  
      username_field.send_keys(username)
      password_field.send_keys(password)
      login_button.click()
      time.sleep(2)
  
      if 'dashboard' in driver.current_url:
          driver.quit()
          return 'Login successful!'
      else:
          driver.quit()
          return 'ERROR: Login failed'