input: Write a function to automate the login process on a given website using Selenium in Python. The function should initialize the web driver, navigate to the target website, enter the username and password, click on the submit button, and verify if the login was successful.
  
  
  from selenium import webdriver
  from selenium.webdriver.common.keys import Keys
  import time
  
  def automate_login(target_website, username, password):
      # Initialize web driver
      driver = webdriver.Chrome()
      
      try:
          # Navigate to the target web page
          driver.get(target_website)
          
          # Locate username field
          username_field = driver.find_element_by_name('username')
          
          # Enter username
          username_field.send_keys(username)
          
          # Locate password field
          password_field = driver.find_element_by_name('password')
          
          # Enter password
          password_field.send_keys(password)
          
          # Locate submit button
          submit_button = driver.find_element_by_name('submit')
          
          # Click submit button
          submit_button.click()
          
          # Wait for login process to complete
          time.sleep(5)
          
          # Check if login was successful
          if 'login successful' in driver.page_source.lower():
              return 'Login successful!'
          else:
              return 'Login failed!'
      finally:
          # Close the browser
          driver.close()
  
  assert automate_login('http://www.example.com', 'username', 'password') == 'Login successful!'
  assert automate_login('http://www.example.com', 'wrong_username', 'password') == 'Login failed!'
  
output: def automate_login(target_website, username, password):
      driver = webdriver.Chrome()
      try:
          driver.get(target_website)
          username_field = driver.find_element_by_name('username')
          username_field.send_keys(username)
          password_field = driver.find_element_by_name('password')
          password_field.send_keys(password)
          submit_button = driver.find_element_by_name('submit')
          submit_button.click()
          time.sleep(5)
          if 'login successful' in driver.page_source.lower():
              return 'Login successful!'
          else:
              return 'Login failed!'
      finally:
          driver.close()