{"id":31952957,"url":"https://github.com/vidigal-code/selenium-login-load","last_synced_at":"2025-10-14T13:26:32.125Z","repository":{"id":317005742,"uuid":"1065629071","full_name":"Vidigal-code/selenium-login-load","owner":"Vidigal-code","description":"This project automates multiple simultaneous logins to the test site using Python and Selenium. The user configures the number of logins, which run in parallel with independent WebDriver instances. The system calculates total execution time and displays clear feedback with success or failure for each login.","archived":false,"fork":false,"pushed_at":"2025-09-28T06:57:25.000Z","size":260,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-28T08:31:39.381Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vidigal-code.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-28T05:37:30.000Z","updated_at":"2025-09-28T06:57:28.000Z","dependencies_parsed_at":"2025-09-28T08:31:53.208Z","dependency_job_id":"53ca8426-5f11-424b-82bc-413829a9403f","html_url":"https://github.com/Vidigal-code/selenium-login-load","commit_stats":null,"previous_names":["vidigal-code/selenium-login-load"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Vidigal-code/selenium-login-load","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vidigal-code%2Fselenium-login-load","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vidigal-code%2Fselenium-login-load/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vidigal-code%2Fselenium-login-load/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vidigal-code%2Fselenium-login-load/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vidigal-code","download_url":"https://codeload.github.com/Vidigal-code/selenium-login-load/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vidigal-code%2Fselenium-login-load/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018708,"owners_count":26086608,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-14T13:26:30.235Z","updated_at":"2025-10-14T13:26:32.114Z","avatar_url":"https://github.com/Vidigal-code.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simultaneous Login Automation - Python + Selenium Grid\n\nAutomate multiple configurable simultaneous logins to the test application:  \n[https://the-internet.herokuapp.com/login](https://the-internet.herokuapp.com/login)\n\n---\n\n## Example \n\n\u003cimg src=\"./example/example.png\" alt=\"\" width=\"800\"/\u003e \n\n---\n\n## Example Docker\n\n\u003cimg src=\"./example/example-docker.png\" alt=\"\" width=\"800\"/\u003e \n\n---\n\n## Example Selenium Grid\n\n\u003cimg src=\"./example/example-selenium-grid.png\" alt=\"\" width=\"800\"/\u003e \n\n---\n\n## Example Interface Gui\n\n\u003cimg src=\"./example/example-interface-gui.png\" alt=\"\" width=\"800\"/\u003e \n\n---\n\n## Example Results output\n\n\u003cimg src=\"./example/example-results-output.png\" alt=\"\" width=\"800\"/\u003e \n\n---\n\n\n## 📚 Documentation\n\n- [README_PT.md](./README_PT.md) — Portuguese documentation.\n\n---\n\n\n## Table of Contents\n\n- [Project Objective](#project-objective)\n- [Features](#features)\n- [Folder Structure](#folder-structure)\n- [Configuration](#configuration)\n- [Execution](#execution)\n- [Generated Results](#generated-results)\n- [Scalability \u0026 Production](#scalability--production)\n- [Monitoring \u0026 Auditing](#monitoring--auditing)\n- [ChromeDriver: Windows, Mac, Linux](#chromedriver-windows-mac-linux)\n- [FAQ](#faq)\n\n---\n\n## Project Objective\n\nAutomate multiple simultaneous logins to [the-internet.herokuapp.com/login](https://the-internet.herokuapp.com/login) using Python 3.13+, Selenium 4+, with a user-configurable quantity.  \nThe total execution time is calculated and displayed, along with the status of each login (success or failure).  \nSuccess validation, artifact exportation, and production-ready setup using Selenium Grid and Docker.\n\n---\n\n## Features\n\n- User input: configure the number of simultaneous logins via CLI or graphical interface.\n- Parallel execution: multiple independent WebDrivers (threads and Selenium Grid).\n- Configurable sequencing (`SEQUENCE=INCREASING|DECREASING|RANDOM`)\n- Artifacts organized by ID: screenshots and HTML saved in folders per login.\n- Automated login: user `tomsmith`, password `SuperSecretPassword!`.\n- Total time calculation: logs and displays after execution.\n- Success validation: checks redirect to success page.\n- Results export: JSON, CSV, TXT, screenshots, and HTML artifacts (for both success and failure).\n- Docker + Selenium Grid production-ready.\n- Monitoring via artifacts and logs.\n- **Centralized messages**: `message_errors.py` and `message_system.py` files facilitate customization, translation, and auditing.\n\n---\n\n## Folder Structure\n\n```\nselenium-login-load/\n├─ source/\n│  ├─ main.py                        # Main entry point (CLI/GUI)\n│  ├─ interface/\n│  │    ├─ gui.py                    # Graphical interface (optional)\n│  ├─ system/\n│  │    ├─ login_worker.py           # Individual login worker\n│  │    ├─ run_logins.py             # Logins orchestrator\n│  ├─ config/\n│  │    ├─ driverconfig.py           # WebDriver configuration\n│  ├─ messages/\n│  │    ├─ message_errors.py         # Centralized error messages\n│  │    ├─ message_system.py         # Centralized system/success messages\n├─ results/\n│  ├─ results.json\n│  ├─ results.csv\n│  ├─ report_summary.txt\n│  ├─ screenshot/\n│  │    ├─ ID-uuid/\n│  │    │    └─ uuid.png\n│  ├─ html/\n│  │    ├─ ID-uuid/\n│  │    │    └─ uuid.html\n├─ .env\n├─ .dockerignore\n├─ .gitignore\n├─ generate_compose_cli.py\n├─ generate_compose_grid.py\n├─ requirements.txt\n├─ Dockerfile\n├─ docker-compose.yml\n├─ entrypoint.sh\n├─ README_PT.md\n├─ README_PROD_PT.md\n├─ README_PROD.md\n└─ README.md\n```\n\n---\n\n## Configuration\n\n### `.env` (example)\n\n```dotenv\n# Configurable limits for simultaneous logins!\nMIN_LOGINS=1      # Minimum allowed simultaneous logins.\nMAX_LOGINS=1000   # Maximum allowed simultaneous logins.\n\n# SEQUENCE defines the type of sequence for login IDs (INCREASING, DECREASING, RANDOM)\nSEQUENCE=RANDOM     # INCREASING, DECREASING, RANDOM\n\n# Number of simultaneous logins (total attempts)\nCONCURRENT_LOGINS=50\n\n# Maximum number of concurrent threads/processes\nMAX_CONCURRENT=10\n\n# Run browser in headless mode? Use 'true' for production.\nHEADLESS=true\n\n# Maximum page load timeout (seconds)\nPAGE_LOAD_TIMEOUT=30\n\n# Maximum wait for elements on page (seconds)\nELEMENT_WAIT_TIMEOUT=10\n\n# Login user\nLOGIN_USERNAME=tomsmith\n\n# Login password\nLOGIN_PASSWORD=SuperSecretPassword!\n\n# Main output folder for results\nOUTPUT_DIR=./results\n\n# Folder for login screenshots\nOUTPUT_DIR_SCREENSHOT=./results/screenshot\n\n# Folder for saving HTML per login\nOUTPUT_DIR_HTML=./results/html\n\n# Save screenshots of login results (true/false)\nSAVE_SCREENSHOTS=true\n\n# Save page HTML after failed login (true/false)\nSAVE_HTML_ON_FAILURE=true\n\n# Export results to JSON (true/false)\nEXPORT_JSON=true\n\n# Export results to CSV (true/false)\nEXPORT_CSV=true\n\n# Selenium execution mode ('local' for local machine, 'grid' for Selenium Grid)\nSELENIUM_MODE=local\n\n# Selenium Hub URL (used only in grid mode)\nSELENIUM_REMOTE_URL=http://selenium-hub:4444/wd/hub\n\n# Login page URL (target application)\nTARGET_URL=https://the-internet.herokuapp.com/login\n\n# URL fragment indicating login success (used for redirect validation)\nTARGET_URL_TO_CHECK=/secure\n\n# Enable/disable Selenium Grid (true/false)\nUSE_GRID=false\n\n# Number of Chrome nodes in Grid (used in docker-compose)\nGRID_NODES=3\n\n# Local ChromeDriver path (required for Windows local execution)\n# Docker Config or windows C:\\WebDriver\\bin\\chromedriver.exe\nCHROMEDRIVER_PATH=/usr/bin/chromedriver\n```\n\n---\n\n### `.env` (execute grid docker)\n\n```dotenv\n# Minimum allowed simultaneous logins.\nMIN_LOGINS=1\n\n# Maximum allowed simultaneous logins.\nMAX_LOGINS=1000\n\n# Sequence type for login IDs: INCREASING, DECREASING or RANDOM.\nSEQUENCE=RANDOM\n\n# Number of simultaneous logins (total attempts).\nCONCURRENT_LOGINS=50\n\n# Maximum number of concurrent threads/processes.\nMAX_CONCURRENT=10\n\n# Run browser in headless mode (no GUI). Use 'true' for production.\nHEADLESS=true\n\n# Maximum page load timeout (seconds).\nPAGE_LOAD_TIMEOUT=30\n\n# Maximum wait for elements on page (seconds).\nELEMENT_WAIT_TIMEOUT=10\n\n# Login user.\nLOGIN_USERNAME=tomsmith\n\n# Login password.\nLOGIN_PASSWORD=SuperSecretPassword!\n\n# Main output folder for results.\nOUTPUT_DIR=./results\n\n# Folder for login screenshots.\nOUTPUT_DIR_SCREENSHOT=./results/screenshot\n\n# Folder for saving HTML per login.\nOUTPUT_DIR_HTML=./results/html\n\n# Save screenshots of login results (true/false).\nSAVE_SCREENSHOTS=true\n\n# Save page HTML after failed login (true/false).\nSAVE_HTML_ON_FAILURE=true\n\n# Export results to JSON (true/false).\nEXPORT_JSON=true\n\n# Export results to CSV (true/false).\nEXPORT_CSV=true\n\n# Selenium execution mode ('local' for local machine, 'grid' for Selenium Grid).\nSELENIUM_MODE=grid\n\n# Selenium Hub URL (used only in grid mode).\nSELENIUM_REMOTE_URL=http://selenium-hub:4444/wd/hub\n\n# Login page URL (target application).\nTARGET_URL=https://the-internet.herokuapp.com/login\n\n# URL fragment indicating login success (used for redirect validation).\nTARGET_URL_TO_CHECK=/secure\n\n# Enable/disable Selenium Grid (true/false).\nUSE_GRID=true\n\n# Number of Chrome nodes in Grid (used in docker-compose).\nGRID_NODES=1\n\n# Local ChromeDriver path (required for Windows local execution).\n# Docker Config or windows C:\\WebDriver\\bin\\chromedriver.exe\nCHROMEDRIVER_PATH=\n```\n\n---\n\n\n## Execution\n\n### Local\n\n1. Install dependencies:\n   ```bash\n   pip install -r requirements.txt\n   ```\n2. Install ChromeDriver matching your Chrome version:\n   - [Google Chrome for Testing: Downloads](https://googlechromelabs.github.io/chrome-for-testing)\n   - Windows: \n     - 64-bit: [Win64 chromedriver](https://storage.googleapis.com/chrome-for-testing-public/140.0.7339.207/win64/chromedriver-win64.zip)\n     - 32-bit: [Win32 chromedriver](https://storage.googleapis.com/chrome-for-testing-public/140.0.7339.207/win32/chromedriver-win32.zip)\n   - Mac:\n     - [chromedriver-mac-arm64.zip](https://storage.googleapis.com/chrome-for-testing-public/140.0.7339.207/mac-arm64/chromedriver-mac-arm64.zip)\n     - [chromedriver-mac-x64.zip](https://storage.googleapis.com/chrome-for-testing-public/140.0.7339.207/mac-x64/chromedriver-mac-x64.zip)\n   - Linux:\n     - [chromedriver-linux64.zip](https://storage.googleapis.com/chrome-for-testing-public/140.0.7339.207/linux64/chromedriver-linux64.zip)\n   - More info: [ChromeDriver Docs](https://developer.chrome.com/docs/chromedriver/downloads?hl=en)\n3. Run logins:\n   ```bash\n   python -m source.main -n 10\n   ```\n   - Change the number as desired.\n   - Use `SEQUENCE=INCREASING`, `SEQUENCE=DECREASING`, or `SEQUENCE=RANDOM` in `.env` to change the order/IDs.\n\n# Docker + Selenium Grid (Production)\n\n## 1. Build Containers\n\n```bash\ndocker compose build\n```\n\n## 2. Start the Complete Environment\n\n```bash\ndocker compose up\n```\n- The app automatically detects Grid or Local mode from your `.env`:\n  - If `SELENIUM_MODE=grid`, it uses Selenium Grid.\n  - If `SELENIUM_MODE=local`, it runs locally.\n- Logs will display **time spent** and **status** for each login attempt.\n\n## 3. Generate and Launch with the Python Grid Script\n\n```bash\npython generate_compose_grid.py\n```\n- This script:\n  - Automatically generates a `docker-compose.yml` with the number of nodes set in `.env` (`GRID_NODES`)\n  - Deletes any previous `docker-compose.yml`\n  - Runs: `docker compose up --build`\n\n## 4. Generate and Launch with the Python CLI Script\n\n```bash\npython generate_compose_cli.py\n```\n- This script:\n  - Automatically generates a `docker-compose.yml`\n  - Deletes any previous `docker-compose.yml`\n  - Runs: `docker compose up --build`\n\n---\n\n### Graphical Interface\n\n```bash\npython -m source.main --gui\n```\n- Enter the desired quantity and click **Run**.\n\n---\n\n## Generated Results\n\n- `results/results.json` → Details for each login (ID, time, status, error, screenshot, HTML)\n- `results/results.csv` → CSV export\n- `results/report_summary.txt` → Summary with total time and status per login\n- `results/screenshot/ID-uuid/uuid.png` → Screenshot (success and failure)\n- `results/html/ID-uuid/uuid.html` → HTML (success and failure)\n\n---\n\n## Scalability \u0026 Production\n\n- Configurable parallelism via `MAX_CONCURRENT` and `CONCURRENT_LOGINS`\n- Distributed Grid for hundreds of simultaneous logins\n- Ready for cloud/on-premises deployment\n- Easily adaptable for other authentication scenarios\n\n---\n\n## Monitoring \u0026 Auditing\n\n- Container and CLI logs display total time and status for each login\n- Success and error artifacts saved for investigation\n- Reports exported in professional formats\n- **Error and system messages centralized** in:\n  - `source/message_errors.py`: module-specific errors.\n  - `source/message_system.py`: success, status, and system feedback messages.\n- Facilitates translation, auditing, and maintenance.\n\n---\n\n## ChromeDriver: Windows, Mac, Linux\n\n- Always download ChromeDriver matching your Chrome version!\n- [Google Chrome for Testing: Downloads](https://googlechromelabs.github.io/chrome-for-testing)\n- For local execution (Windows, Mac, Linux), set `CHROMEDRIVER_PATH` in `.env`.\n- For Docker/Grid, ChromeDriver setup is automatic.\n\n---\n\n## FAQ\n\n**Do I need ChromeDriver locally?**  \n- Only for local execution. Not needed for Grid/Docker.\n\n**How do I adjust for more or fewer logins?**  \n- Edit `CONCURRENT_LOGINS` in `.env` or use the `-n` argument.\n\n**Which artifacts are used for auditing?**  \n- JSON, CSV, TXT, PNG, and HTML are generated in the `results/` folder.\n\n**How do I scale to hundreds of logins?**  \n- Adjust `MAX_CONCURRENT` and `CONCURRENT_LOGINS` in `.env` and increase Chrome nodes in `docker-compose.yml`.\n\n**How do I set the sequence for IDs and display order?**  \n- Use `SEQUENCE=INCREASING`, `SEQUENCE=DECREASING`, or `SEQUENCE=RANDOM` in `.env`.\n\n**PySimpleGUI not working?**  \n- Follow installation instructions in the README to install from the private repository.\n\n---\n\n## Contact\n\nFor questions, suggestions, or bugs, open an [issue](https://github.com/Vidigal-code/).\n\n---\n\n## Extra Notes\n\n- Code meets 100% of challenge requirements, production-ready.\n- Artifacts generated for both success and failure for auditing.\n- Maintained up to date for Python 3.13.7, Selenium 4+, Docker, and Grid.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvidigal-code%2Fselenium-login-load","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvidigal-code%2Fselenium-login-load","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvidigal-code%2Fselenium-login-load/lists"}