input: Write a function to automate the login process in a given website using Selenium in Python. The function should navigate to the target website, locate the username and password fields, enter the login credentials, and click the submit button. If the login process is successful, the function should print "Login successful!".
  
  
  from selenium import webdriver
  from selenium.webdriver.common.keys import Keys
  import time
  
  def automate_login(url, username_field_name, password_field_name, submit_button_name, username, password):
      # Initialize web driver
      driver = webdriver.Chrome()
  
      # Navigate to the target web page
      driver.get(url)
  
      # Locate username field
      username_field = driver.find_element_by_name(username_field_name)
  
      # Enter username
      username_field.send_keys(username)
  
      # Locate password field
      password_field = driver.find_element_by_name(password_field_name)
  
      # Enter password
      password_field.send_keys(password)
  
      # Locate submit button
      submit_button = driver.find_element_by_name(submit_button_name)
  
      # Click submit button
      submit_button.click()
  
      # Wait for login process to complete
      time.sleep(5)
  
      # Print login status
      print('Login successful!')
  
      driver.close()
  
  # Test cases
  assert automate_login('http://www.example.com', 'username', 'password', 'submit', 'my_username', 'my_password') == None
  assert automate_login('http://www.example.com', 'username', 'password', 'submit', 'another_username', 'another_password') == None
  
output: def automate_login(url, username_field_name, password_field_name, submit_button_name, username, password):
      driver = webdriver.Chrome()
      driver.get(url)
      username_field = driver.find_element_by_name(username_field_name)
      username_field.send_keys(username)
      password_field = driver.find_element_by_name(password_field_name)
      password_field.send_keys(password)
      submit_button = driver.find_element_by_name(submit_button_name)
      submit_button.click()
      time.sleep(5)
      print('Login successful!')
      driver.close()