input: Write a function to automate the login process on a given website using Selenium in Python. The function should take the URL of the target website as an input, automate the login with given credentials, and print "Login successful!" upon successful login. If the login process fails, the function should handle it appropriately.
  assert automate_login('http://www.example.com')=='Login successful!'
  assert automate_login('http://www.differentsite.com')=='Login successful!'
  assert automate_login('')=='Login unsuccessful!'
  assert automate_login('http://www.example.com')=='Login successful!'
output: def automate_login(url):
      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.webdriver.chrome.options import Options
      from selenium.common.exceptions import NoSuchElementException
      import time
  
      chrome_options = Options()
      chrome_options.add_argument("--headless")
      service = Service(executable_path='/path/to/chromedriver')
      driver = webdriver.Chrome(service=service, options=chrome_options)
  
      try:
          driver.get(url)
          time.sleep(2)
  
          username = driver.find_element(By.ID, 'username')
          password = driver.find_element(By.ID, 'password')
          login_button = driver.find_element(By.ID, 'loginButton')
  
          username.send_keys('your_username')
          password.send_keys('your_password')
          login_button.click()
  
          time.sleep(2)
  
          if "Login successful!" in driver.page_source:
              return "Login successful!"
          else:
              return "Login unsuccessful!"
      except NoSuchElementException:
          return "Login unsuccessful!"
      finally:
          driver.quit()