Test Automation Engineer study guide
Linear Scripting vs Structured Scripting
Linear Scripting ("Record and Playback") involves capturing a user's manual actions into a single, monolithic, unoptimized script. Structured Scripting improves upon this by using control flow structures (if/else, loops) and modular functions to make the code reusable and maintainable.
Practical example
Linear Scripting: Hardcodes test data, repeats the same login code in every test, and breaks immediately if the UI changes by one pixel. It can be quick to create but may become costly to maintain as the suite grows. Structured Scripting: Extracts the login process into a reusable login(user, pass) function. If the login button ID changes, the engineer updates it in one function, fixing hundreds of tests instantly.
Exam scenario and common trap
Question: When is Linear Scripting considered an acceptable approach? The Trap: "It is never acceptable in modern automation." The Correct Answer: It is acceptable for one-off tasks, rapid prototyping, or creating quick disposable scripts to populate a database once. It is not suitable for a long-term regression suite.
Related syllabus sections cover this topic. Reference sections: 3.1.4. See the official ISTQB syllabus for exam scope. Examples are independent; QA-ace is not affiliated with ISTQB.