Skip to content

About

Selenium-based end-to-end automation script that navigates a 9-page signup flow, including Gmail OTP verification via IMAP, dropdown retry logic, and human-like input simulation across each step.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

Repository files navigation

Signup Automation (Python + Selenium)

End-to-end browser automation of a 9-page partner-signup flow, including email OTP verification over IMAP, file upload and a per-run test report.

Demo (6x speed)

Full-length recording: docs/demo_video.mp4 · Example manual test report: docs/sample_test_report.pdf

Why this exists

Multi-step signup forms with OTP are slow and error-prone to test by hand. This project drives the whole journey the way a user would, so a regression anywhere in the flow is caught in one run, with logs, screenshots and a report to show where it broke.

Features

  • 9-page flow: entry → terms → account details → OTP → agency details → experience → business details → submission check → logout.
  • OTP via IMAP: polls Gmail for the verification mail addressed to this run's unique +tag address and extracts the 6-digit code.
  • Unique data per run: Gmail plus-addressing and a random phone number, so runs never collide.
  • Retry logic: flaky pages (dropdowns, dynamic forms) retry up to N times before the run fails.
  • Explicit waits: no fixed sleeps for synchronisation; human-like typing delay is configurable.
  • File upload through the page's <input type="file">.
  • Failure diagnostics: screenshot per failed step, console + file logging, non-zero exit code.
  • Reporting: Markdown and JSON report per run.
  • Zero-setup driver: Selenium Manager downloads the matching ChromeDriver.
  • All credentials and data live in .env; all locators live in one file.

Setup

Requires Python 3.10+ and Google Chrome.

git clone https://github.com/nischalk17/Signup-Automation---Python-Selenium
cd Signup-Automation---Python-Selenium
python -m venv .venv
.venv\Scripts\activate          # macOS/Linux: source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env            # Windows: copy .env.example .env

Gmail app password

OTP mails are read over IMAP, so use a dedicated test Gmail account:

  1. Enable 2-Step Verification, then create an App Password (Google Account → Security → App passwords).
  2. Put the account and the 16-character password in .env.

Configuration

Set in .env (see .env.example); required keys are the first three.

Variable Purpose Default
GMAIL_USER Inbox that receives the OTP required
GMAIL_APP_PASSWORD Google App Password required
TEST_PASSWORD Password for the test signup required
BASE_URL Site login URL authorized-partner.netlify.app/login
RESUME_PATH File to upload assets/sample_document.pdf
HEADLESS Run without a window false
WAIT_TIMEOUT / OTP_TIMEOUT / OTP_POLL_INTERVAL Seconds 15 / 60 / 5
TYPING_DELAY Seconds between keystrokes 0.03
OUTPUT_DIR Logs, screenshots, reports output
FIRST_NAME, LAST_NAME, AGENCY_* Form data sample values

Usage

python -m signup_automation                       # visible browser
python -m signup_automation --headless            # no window (CI-friendly)
python -m signup_automation --config staging.env  # alternate settings file
python -m signup_automation --keep-open -v        # pause at the end, debug logs

Exit code: 0 all steps passed, 1 a step failed, 2 configuration error.

Sample report

output/report_<timestamp>_<id>.md (a .json twin and a .log are written alongside):

# Run report `a1b2c3`
- Result: **PASSED**

| # | Step                         | Status | Time (s) | Attempts | Notes |
|---|------------------------------|--------|----------|----------|-------|
| 1 | 1. Open site & go to Sign Up | PASSED | 2.1      | 1        |       |
| 2 | 2. Accept terms              | PASSED | 0.8      | 1        |       |
| 3 | 3. Account details           | PASSED | 6.4      | 1        |       |
| 4 | 4. OTP verification          | PASSED | 11.9     | 1        |       |
| … | …                            | …      | …        | …        |       |
| 9 | 9. Logout                    | PASSED | 2.2      | 1        |       |

(Illustrative values. A failed step shows its error and the path of its screenshot.)

Project structure

signup_automation/
├── cli.py        # argparse entry point, logging, browser creation
├── config.py     # .env loading and validation (Settings dataclass)
├── flow.py       # the 9 steps + runner (retries, screenshots, results)
├── selectors.py  # every locator, in one place
├── otp.py        # IMAP polling and OTP extraction
└── report.py     # Markdown/JSON run reports
assets/           # sample file used for the upload step
docs/             # demo GIF/video, sample manual test report
.env.example      # configuration template

Responsible use

Only run this against sites you own or have explicit permission to test. It creates real accounts and sends real emails; use dedicated test accounts, keep your .env out of version control, and respect the target site's terms and rate limits.

License

MIT © Nischal Dhoj Kunwar

About

Selenium-based end-to-end automation script that navigates a 9-page signup flow, including Gmail OTP verification via IMAP, dropdown retry logic, and human-like input simulation across each step.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages