ScholarQuill logoScholarQuillUniversity Notes
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
Study Tools
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
Contact
ScholarQuill logo
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
ScholarQuill logoScholarQuillUniversity Notes
Study PortalCOMP4125Automated Testing Scri…
Ctrl + K
Login
Explore
Search
Semester
Papers
CGPA
    COMP4125

    Software Testing & Quality Assurance

    Progress0 / 9 done
    Topics9
    1Testing techniques2Black Box testing techniques3White Box testing techniques4Grey Box testing techniques5Quality Assurance planning and execution
    6constructing a framework7Scripting techniques for automated testing8Generating test data9Generating test reports
    3 min read
    Topic 7 of 9
    Topic Study Note Illustration
    07

    Scripting techniques for automated testing

    Definition: Test scripting is the process of writing code (scripts) to automate test cases .

    πŸ“˜ SCRIPTING TECHNIQUES FOR AUTOMATED TESTING


    βœ… 1. What is Test Scripting?

    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.


    🎯 Key Idea:

    • Scripts = instructions for testing tools
    • Used in automation tools like Selenium

    🟒 2. WHY SCRIPTING IS IMPORTANT?

    • Saves time
    • Reduces human errors
    • Allows repeated execution
    • Supports regression testing

    🧩 3. TYPES OF SCRIPTING TECHNIQUES


    πŸ”΅ 1. LINEAR SCRIPTING (Record & Playback)

    πŸ“Œ Definition:

    Tester records actions and tool converts them into scripts.


    πŸͺœ Steps:

    1. Start recording
    2. Perform actions (login, click, etc.)
    3. Stop recording
    4. Replay script

    πŸ“Š Example:

    Open browser β†’ Enter username β†’ Enter password β†’ Click login
    

    🎯 Key Points:

    • Simple and easy
    • No coding required

    ❌ Limitation:

    • Not reusable

    πŸ‘‰ πŸ”₯ Important for basic understanding


    🟒 2. STRUCTURED SCRIPTING

    πŸ“Œ Definition:

    Scripts are written in a structured way using functions and logic.


    πŸͺœ Steps:

    1. Divide script into functions
    2. Use loops and conditions
    3. Organize code

    πŸ“Š Example:

    function login(){
      enterUsername();
      enterPassword();
      clickLogin();
    }
    

    🎯 Key Points:

    • More organized
    • Reusable

    🟑 3. DATA-DRIVEN SCRIPTING

    πŸ“Œ Definition:

    Test data is stored separately from scripts.


    πŸ“Š Example:

    Username Password
    user1 pass1
    user2 pass2

    πŸͺœ Working:

    1. Script reads data
    2. Executes same test multiple times

    🎯 Key Points:

    • Reduces duplication
    • Flexible

    πŸ‘‰ πŸ”₯ Frequently asked!


    🟣 4. KEYWORD-DRIVEN SCRIPTING

    πŸ“Œ Definition:

    Uses keywords instead of writing full code.


    πŸ“Š Example:

    Keyword Action
    OpenBrowser Launch browser
    Login Enter credentials
    Click Press button

    🎯 Key Points:

    • Easy for non-programmers
    • High-level abstraction

    🟠 5. MODULAR SCRIPTING

    πŸ“Œ Definition:

    Application is divided into small modules, each with separate scripts.


    πŸ“Š Example:

    • Login module
    • Payment module

    🎯 Key Points:

    • Reusable modules
    • Easy maintenance

    πŸ”΄ 6. HYBRID SCRIPTING

    πŸ“Œ Definition:

    Combination of multiple scripting techniques.


    πŸ“Š Example:

    • Data-driven + keyword-driven

    🎯 Key Point:

    • Most commonly used in real projects

    πŸ“Š DIAGRAM: SCRIPTING TECHNIQUES OVERVIEW

    Scripting Techniques
           |
    -----------------------------------------
    | Linear | Structured | Data | Keyword |
    | Modular | Hybrid |
    

    πŸͺœ 4. BEST PRACTICES FOR SCRIPTING


    βœ… Use Meaningful Names

    • Example: loginTest()

    βœ… Keep Scripts Reusable

    • Avoid repetition

    βœ… Separate Test Data

    • Use external files

    βœ… Add Comments

    • Easy understanding

    βœ… Handle Errors

    • Use exception handling

    βš–οΈ ADVANTAGES & DISADVANTAGES

    βœ… Advantages:

    • Fast execution
    • Reusability
    • Accurate results

    ❌ Disadvantages:

    • Requires coding skills
    • Initial setup time
    • Maintenance needed

    πŸ”₯ FREQUENTLY ASKED EXAM POINTS

    βœ” Define Test Scripting βœ” Types of scripting techniques βœ” Data-driven scripting explanation βœ” Keyword-driven scripting example βœ” Difference between linear & modular


    πŸ“Š QUICK REVISION TABLE

    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

    🎯 FINAL SUMMARY

    • Test scripting is writing automation code

    • Main techniques:

      • Linear (basic)
      • Structured (organized)
      • Data-driven (important)
      • Keyword-driven
      • Modular
      • Hybrid (most used)
    • Focus on:

      • Reusability
      • Maintainability
      • Efficiency

    ← Previous topic 6
    Automated testing: constructing a framework
    Next topic 8 β†’
    Generating test data

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    3mremaining
    492words
    Beginnerlevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Software Testing & Quality Assurance