Selenium ToDo Automation

Automated testing solution for ToDo web applications using Python and Selenium WebDriver

Project Overview

This Selenium automation project tests all critical functionality of a ToDo web application, including task management, priority setting, and theme switching. The script follows industry best practices for reliable and maintainable test automation.

Key Features

Browser Automation

Automates Chrome browser with dynamic driver management using ChromeDriverManager

UI Testing

Comprehensive testing of user interface elements and interactions

Form Validation

Tests complete form workflows including input validation

State Verification

Validates application state after each interaction

Test Script

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
from webdriver_manager.chrome import ChromeDriverManager
import time

# Initialize WebDriver
options = Options()
options.add_argument("--start-maximized")
driver = webdriver.Chrome(
    service=Service(ChromeDriverManager().install()),
    options=options
)

# Test Case 1: Open application
driver.get("https://todocodehavens.netlify.app/")
time.sleep(3)

# Test Case 2: Toggle theme
driver.find_element(
    By.XPATH, "//button[normalize-space()='Switch to Light Mode']"
).click()
time.sleep(2)

# Test Case 3: Add task
driver.find_element(
    By.XPATH, "//input[@placeholder='Task name...']"
).send_keys("game")
driver.find_element(
    By.XPATH, "//input[@name='dueDate']"
).send_keys("11-11-2026")
priority_dropdown = Select(driver.find_element(By.NAME, "priority"))
priority_dropdown.select_by_visible_text("High")
driver.find_element(
    By.XPATH, "//button[normalize-space()='Add']"
).click()
time.sleep(3)

# Test Case 4: Delete task
driver.find_element(
    By.XPATH, "//button[normalize-space()='Delete']"
).click()
time.sleep(5)

# Clean up
driver.quit()

Test Execution Flow

1

Initialize Browser

Set up Chrome WebDriver with maximized window using ChromeDriverManager

2

Navigate to App

Open the ToDo application URL and wait for page load

3

Theme Testing

Verify light/dark mode toggle functionality

4

Task Management

Test complete task lifecycle (create, view, delete)

5

Clean Up

Close browser and end test session

View Live Application View on GitHub