What is Test Automation?
Imagine you work at a factory testing light bulbs. Screw one in, flip the switch, watch it light. Repeat 5000 times. By bulb 200 you are bored, by 500 you are missing failures. Software testing has the same problem: every release, you re-check the same login screen, the same checkout flow, the same payment page.
Test automation is writing a small program that does that re-checking for you. The program does not get bored. It does not skip steps. It runs in three minutes instead of three hours.
The recipe
Every automated test is a recipe written for a robot:
- Open the website.
- Type "[email protected]" in the email field.
- Type "Test@1234" in the password field.
- Click the Login button.
- Check that the page now shows "Welcome, Ravi".
Run the recipe once, you have done one test. Run it 100 times across 100 builds, the cost per run is almost zero.
Two parts to learn
- The automation tool does the typing and clicking. Selenium, Playwright, and Cypress are the popular ones. We start with Selenium.
- A programming language glues the steps together. We use Python because it reads like English and is the most common QA language in India.
That is the whole job at a high level. The rest of this course is just practising the recipe writing.
Quick check
Q1. A test that runs the same five steps every release is a good candidate for automation. Which of these is the poor candidate?
A. Daily smoke test of the login page. B. Regression test of the checkout flow before every release. C. One-off exploratory test of a brand-new UI design that may change tomorrow. D. Nightly test that yesterday's data export contains the right number of rows.
Hint: Automation pays off when you re-run the same test. What does "one-off" mean?
Answer: C. Automating a UI that is about to change wastes effort, the test breaks the moment the design changes. Stick to exploratory testing for fluid UIs and automate the stable, repeated checks.
Q2. Your manager asks "why automate, can't we just test manually?" In one sentence, what is the strongest answer?
Hint: Think about what changes between release 1 and release 50.
Answer: Manual testing cost stays the same every release; automation cost is paid once and the per-run cost drops to almost zero, so by release 5-10 automation is already cheaper, and faster.
Try this
Pick one app you use daily (UPI, Swiggy, Gmail). Write down five steps of a flow you would automate, exactly like the recipe above. Save it, you will turn it into a real Selenium script later in the course.