Definition: Test scripting is the process of writing code (scripts) to automate test cases.
👉 Simple meaning: Instead of manually testing, we write scripts that perform testing automatically.
Tester records actions and tool converts them into scripts.
Open browser → Enter username → Enter password → Click login
👉 🔥 Important for basic understanding
Scripts are written in a structured way using functions and logic.
function login(){
enterUsername();
enterPassword();
clickLogin();
}
Test data is stored separately from scripts.
| Username | Password |
|---|---|
| user1 | pass1 |
| user2 | pass2 |
👉 🔥 Frequently asked!
Uses keywords instead of writing full code.
| Keyword | Action |
|---|---|
| OpenBrowser | Launch browser |
| Login | Enter credentials |
| Click | Press button |
Application is divided into small modules, each with separate scripts.
Combination of multiple scripting techniques.
Scripting Techniques
|
-----------------------------------------
| Linear | Structured | Data | Keyword |
| Modular | Hybrid |
loginTest()✔ Define Test Scripting ✔ Types of scripting techniques ✔ Data-driven scripting explanation ✔ Keyword-driven scripting example ✔ Difference between linear & modular
| Technique | Key Idea | Advantage | Disadvantage |
|---|---|---|---|
| Linear | Record/playback | Easy | Not reusable |
| Structured | Organized code | Reusable | Needs coding |
| Data-Driven | Separate data | Flexible | Complex |
| Keyword-Driven | Keywords | Easy | Slower |
| Modular | Divide modules | Maintainable | Setup effort |
| Hybrid | Combination | Powerful | Complex |
Test scripting is writing automation code
Main techniques:
Focus on:
Open this section to load past papers