How mfaisalkhatri/selenium-ai-test-generator works
This repository is an AI-powered Selenium Java test generator. The main workflow checks the selected LLM, reads a plain-English test case, builds a POM/TestNG-oriented prompt, generates code through OpenAI or Ollama, and writes parsed files to a timestamped output directory. README documents generated page objects, a test class, testng.xml, and README; the checked-in examples show search and registration scenarios. Edges reflect the shown Python calls or README workflow; generated artifacts are examples, not runtime modules.
Main entry points: main.py Generation runner · tools.py LLM connectivity check · config.py Application configuration · sample_test_case.txt Test case input
Components 14
Generation workflow
- Test case input
test_cases/input/sample_test_case.txt - Generation runner
main.py - LLM connectivity check
tools.py - Test case loader
tools.py - Prompt builder
tools.py - Provider dispatch
tools.py - File splitter and writer
tools.py - Timestamped output
test_cases/output - Java POM and TestNG artifacts
test_cases/output/2026-08-13_18-46-45/SearchProductTest.java
LLM providers
- OpenAI service
- Ollama service
Configuration and logging
- Application configuration
config.py - Application logger
logger.py
Other components
- Test author
Connections 20
- Test author → Test case input: writes case
README.md - Test author → Generation runner: starts generator
README.md - Generation runner → LLM connectivity check: checks provider
main.py - Generation runner → Test case loader: loads case
main.py - Test case loader → Test case input: reads
tools.py - Generation runner → Prompt builder: requests generation
main.py - Prompt builder → Provider dispatch: builds prompt
tools.py - Provider dispatch → OpenAI service: sends prompt
tools.py - Provider dispatch → Ollama service: sends prompt
tools.py - Generation runner → Timestamped output: creates directory
main.py - Generation runner → File splitter and writer: saves response
main.py - File splitter and writer → Timestamped output: writes files
tools.py - File splitter and writer → Java POM and TestNG artifacts: creates artifacts
README.md - LLM connectivity check → OpenAI service: checks models
tools.py - LLM connectivity check → Ollama service: checks endpoint
tools.py - Generation runner → Application configuration: reads file paths
main.py - LLM connectivity check → Application configuration: reads provider settings
tools.py - Provider dispatch → Application configuration: reads model settings
tools.py - Generation runner → Application logger: logs workflow
main.py - LLM connectivity check → Application logger: logs checks
tools.py