|
@@ -1,12 +1,24 @@
|
|
|
# Automation Test Script Template
|
|
|
|
|
|
-# 1. Import required Selenium libraries and other dependencies
|
|
|
-from selenium import webdriver
|
|
|
+import selenium.webdriver
|
|
|
from selenium.webdriver.common.keys import Keys
|
|
|
-import time
|
|
|
-import unittest
|
|
|
-from selenium.webdriver.support.ui import WebDriverWait
|
|
|
-from selenium.webdriver.support import expected_conditions as EC
|
|
|
-from selenium.webdriver.common.by import By
|
|
|
-# Add call to print_current_time at the end of the script
|
|
|
-print_current_time()
|
|
|
+
|
|
|
+def test_login():
|
|
|
+ test_scenario = "Login Test for <Application Name>"
|
|
|
+ driver = selenium.webdriver.Chrome()
|
|
|
+ driver.get("http://example.com/login")
|
|
|
+
|
|
|
+ username_field = driver.find_element_by_id("username")
|
|
|
+ username_field.send_keys("test_user")
|
|
|
+
|
|
|
+ password_field = driver.find_element_by_id("password")
|
|
|
+ password_field.send_keys("test_password")
|
|
|
+
|
|
|
+ login_button = driver.find_element_by_id("loginButton")
|
|
|
+ login_button.click()
|
|
|
+
|
|
|
+ # Print completion date and time
|
|
|
+ import datetime
|
|
|
+ print(f"Test completed on {datetime.datetime.now()}")
|
|
|
+
|
|
|
+test_login()
|