ScholarQuill logoScholarQuillUniversity Notes
  • Notes
  • Past Papers
  • Blogs
  • Todo
Login
ScholarQuill logoScholarQuillUniversity Notes
Login
NotesPast PapersBlogsTodo
More
SubjectsDiscussionCGPA CalculatorGPA CalculatorStudent PortalCourse Outline
About
About usPrivacy PolicyReportContact
Notes
Past Papers
Blogs
Todo
Analytics
    Current Subject
    🧩
    Software Testing & Quality Assurance
    COMP4125
    Progress0 / 9 topics
    Topics
    1. Testing techniques2. Black Box testing techniques3. White Box testing techniques4. Grey Box testing techniques5. Quality Assurance planning and execution6. Automated testing: constructing a framework7. Scripting techniques for automated testing8. Generating test data9. Generating test reports
    COMP4125›Scripting techniques for automated testing
    Software Testing & Quality AssuranceTopic 7 of 9

    Scripting techniques for automated testing

    3 minread
    492words
    Beginnerlevel

    📘 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 load past papers

    Click on Show Past Papers to see past papers.
    On This Page
      Reading Stats
      Est. reading time3 min
      Word count492
      Code examples0
      DifficultyBeginner