input: Write a function to automate the login process using Selenium in Python for a given website. The function should initialize a web driver, navigate to the target website, locate the username and password fields, enter the credentials, and then submit the form. Finally, the function should indicate whether the login was successful or not.
  from selenium import webdriver
  from selenium.webdriver.common.keys import Keys
  import time
  
  def login_automation(website, user_name, pass_word):
      # Initialize web driver
      driver = webdriver.Chrome()
      
      # Navigate to the target web page
      driver.get(website)
      
      # Locate username field
      username = driver.find_element_by_name('username')
      
      # Enter username
      username.send_keys(user_name)
      
      # Locate password field
      password = driver.find_element_by_name('password')
      
      # Enter password
      password.send_keys(pass_word)
      
      # 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
      try:
          if driver.title == 'Login Successful':
              print('Login successful!')
              driver.close()
              return True
          else:
              print('Login failed!')
              driver.close()
              return False
      except:
          print('Login failed!')
          driver.close()
          return False
  
  assert login_automation('http://www.example.com', 'username', 'password')==True
output: def login_automation(website, user_name, pass_word):
      driver = webdriver.Chrome()
      driver.get(website)
      username = driver.find_element_by_name('username')
      username.send_keys(user_name)
      password = driver.find_element_by_name('password')
      password.send_keys(pass_word)
      submit_button = driver.find_element_by_name('submit')
      submit_button.click()
      time.sleep(5)
      try:
          if driver.title == 'Login Successful':
              driver.close()
              return True
          else:
              driver.close()
              return False
      except:
          driver.close()
          return False