Bird
Raised Fist0
Testing Fundamentalstesting~20 mins

Automation framework types in Testing Fundamentals - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Automation Framework Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Data-Driven Frameworks

Which statement best describes a data-driven automation framework?

ATest cases are written only once and cannot be reused with different data inputs.
BTest scripts are tightly coupled with the application UI elements, making maintenance easier.
CTest scripts are separated from test data, allowing multiple data sets to run the same test logic.
DTest execution depends on manual input during runtime to decide the next steps.
Attempts:
2 left
💡 Hint

Think about how test data and test scripts interact in this framework type.

❓ Predict Output
intermediate
2:00remaining
Output of Keyword-Driven Framework Example

Given this simplified keyword-driven test step list, what will be the output after execution?

steps = [
  {'keyword': 'open_browser', 'value': 'chrome'},
  {'keyword': 'navigate', 'value': 'https://example.com'},
  {'keyword': 'click', 'value': 'login_button'},
  {'keyword': 'input', 'value': 'username_field:admin'},
  {'keyword': 'input', 'value': 'password_field:1234'},
  {'keyword': 'click', 'value': 'submit_button'}
]
output = []
for step in steps:
  output.append(f"Executed {step['keyword']} with {step['value']}")
print(output)
A["Executed open_browser with chrome", "Executed navigate with https://example.com", "Executed click with login_button", "Executed input with username_field:admin", "Executed input with password_field:1234", "Executed click with submit_button"]
B["open_browser chrome", "navigate https://example.com", "click login_button", "input username_field:admin", "input password_field:1234", "click submit_button"]
C["Executed open_browser", "Executed navigate", "Executed click", "Executed input", "Executed input", "Executed click"]
DSyntaxError: invalid syntax in the for loop
Attempts:
2 left
💡 Hint

Look at how the output list is built inside the loop.

❓ assertion
advanced
2:00remaining
Assertion in Hybrid Framework Testing

In a hybrid automation framework combining keyword-driven and data-driven approaches, which assertion best verifies that a login test passed?

Aassert browser.open() # Checks if browser opened successfully
Bassert input('Enter username: ') == 'admin' # Checks user input correctness
Cassert len(test_data) > 0 # Checks if test data exists
Dassert page.title == 'Dashboard' # Checks if user reached dashboard after login
Attempts:
2 left
💡 Hint

Think about what confirms a successful login in the application.

🔧 Debug
advanced
2:00remaining
Debugging Modular Framework Code

Identify the error in this modular framework test function:

def test_search():
    open_browser('firefox')
    enter_text('search_box', 'testing')
    click_button('search_btn')
    result = get_text('result_count')
    assert int(result) > 0
    close_browser()
ANameError because open_browser is not defined
BTypeError because get_text returns a string and cannot be compared with integer 0
CAssertionError because result is always zero
DNo error, the test runs successfully
Attempts:
2 left
💡 Hint

Consider the data types involved in the assertion.

❓ framework
expert
3:00remaining
Choosing the Best Framework for Complex Test Suites

You need to automate a large web application with many reusable components and varying test data sets. Which framework type best fits this scenario?

AHybrid framework combining modular design with data-driven testing for flexibility and reuse
BRecord and playback framework for quick test creation without scripting
CLinear scripting framework with hardcoded test steps for simplicity
DManual testing only, as automation is too complex
Attempts:
2 left
💡 Hint

Consider maintainability and reusability for large projects.

Practice

(1/5)
1. Which automation framework type is best described as a simple, step-by-step script without reusable modules?
easy
A. Linear automation framework
B. Modular automation framework
C. Data-driven automation framework
D. Keyword-driven automation framework

Solution

  1. Step 1: Understand the framework types

    Linear framework runs tests in a sequential, simple script without reusable parts.
  2. Step 2: Match description to framework

    Since the question describes a simple step-by-step script without modules, it matches the linear framework.
  3. Final Answer:

    Linear automation framework -> Option A
  4. Quick Check:

    Simple step-by-step = Linear [OK]
Hint: Simple scripts without reuse? Think linear [OK]
Common Mistakes:
  • Confusing linear with modular frameworks
  • Thinking data-driven means simple scripts
  • Mixing keyword-driven with linear
2. Which of the following is the correct description of a data-driven automation framework?
easy
A. Tests are written using keywords representing actions
B. Tests are executed in a linear sequence without modules
C. Tests are divided into reusable modules
D. Test data is separated from scripts and stored externally

Solution

  1. Step 1: Recall data-driven framework concept

    Data-driven frameworks separate test data from test scripts, often using external files like Excel or CSV.
  2. Step 2: Match options to definition

    Test data is separated from scripts and stored externally correctly states that test data is stored externally and separated from scripts.
  3. Final Answer:

    Test data is separated from scripts and stored externally -> Option D
  4. Quick Check:

    Data separated from scripts = Data-driven [OK]
Hint: Data outside scripts? That's data-driven [OK]
Common Mistakes:
  • Confusing keyword-driven with data-driven
  • Thinking linear means data separation
  • Mixing modular with data-driven
3. Consider this pseudocode snippet in a keyword-driven framework:
keywords = ["open_browser", "login", "click_button", "logout"]
for action in keywords:
    execute(action)

What is the main advantage of this approach?
medium
A. Test actions are represented by keywords making tests readable and reusable
B. Test logic is separated from test data
C. Test steps are hardcoded and not reusable
D. Test data is embedded inside the test scripts

Solution

  1. Step 1: Understand keyword-driven framework

    Keyword-driven frameworks use keywords to represent test actions, making tests easy to read and reuse.
  2. Step 2: Analyze the pseudocode

    The code loops through keywords and executes actions, showing separation of test logic using keywords.
  3. Final Answer:

    Test actions are represented by keywords making tests readable and reusable -> Option A
  4. Quick Check:

    Keywords for actions = Keyword-driven advantage [OK]
Hint: Keywords mean readable and reusable tests [OK]
Common Mistakes:
  • Thinking test data is embedded in keywords
  • Confusing keyword-driven with linear
  • Assuming hardcoded steps mean keyword-driven
4. You have a modular automation framework but notice tests are failing because modules are not reusable. What is the likely error?
medium
A. Keywords are not defined properly
B. Modules are tightly coupled and not independent
C. Tests are written in a linear sequence
D. Test data is stored externally

Solution

  1. Step 1: Understand modular framework principles

    Modular frameworks require modules to be independent and reusable.
  2. Step 2: Identify cause of failure

    If modules are tightly coupled, they cannot be reused properly, causing test failures.
  3. Final Answer:

    Modules are tightly coupled and not independent -> Option B
  4. Quick Check:

    Coupled modules break reuse = Modular error [OK]
Hint: Modules must be independent to reuse [OK]
Common Mistakes:
  • Blaming external test data for module reuse
  • Confusing linear sequence with modular issues
  • Assuming keyword problems cause module reuse failure
5. A hybrid automation framework combines features of multiple frameworks. Which combination below best describes a hybrid framework?
hard
A. Linear scripts with external test data files
B. Data-driven tests without reusable modules
C. Modular reusable components with keyword-driven test execution
D. Only keyword-driven tests without data separation

Solution

  1. Step 1: Understand hybrid framework concept

    Hybrid frameworks mix features like modular design and keyword-driven execution for flexibility and reuse.
  2. Step 2: Evaluate options for combined features

    Modular reusable components with keyword-driven test execution combines modular reusable components and keyword-driven execution, fitting hybrid framework definition.
  3. Final Answer:

    Modular reusable components with keyword-driven test execution -> Option C
  4. Quick Check:

    Hybrid = Modular + Keyword-driven mix [OK]
Hint: Hybrid mixes modular and keyword-driven [OK]
Common Mistakes:
  • Thinking linear with data files is hybrid
  • Ignoring modular or keyword features in hybrid
  • Confusing data-driven only as hybrid
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard