0
0
Testing Fundamentalstesting~20 mins

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

Choose your learning style9 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.