
Definition: Test scripting is the process of writing code (scripts) to automate test cases .
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 view and download past papers
Click on Show Past Papers to load available exam papers.