0
0
Testing Fundamentalstesting~10 mins

Behavior-driven development (BDD) concept in Testing Fundamentals - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a BDD scenario title.

Testing Fundamentals
Scenario: [1]
Drag options to blanks, or click blank then click option'
AUser logs in successfully
Bprint('Hello World')
Cassert True
Ddef test_login():
Attempts:
3 left
💡 Hint
Common Mistakes
Using code statements instead of descriptive titles.
Leaving the scenario title empty.
2fill in blank
medium

Complete the code to write a Given step in BDD.

Testing Fundamentals
Given [1]
Drag options to blanks, or click blank then click option'
Aassert login() == True
Bthe user is on the login page
Cprint('Start test')
Ddef setup():
Attempts:
3 left
💡 Hint
Common Mistakes
Writing code instead of descriptive context.
Using assertions in Given step.
3fill in blank
hard

Fix the error in the When step by completing the code.

Testing Fundamentals
When [1]
Drag options to blanks, or click blank then click option'
Aassert submit()
Bprint('Action performed')
Cthe user enters valid credentials
Ddef action():
Attempts:
3 left
💡 Hint
Common Mistakes
Using code or assertions instead of plain language.
Leaving the When step empty.
4fill in blank
hard

Fill both blanks to complete the Then step describing the expected outcome.

Testing Fundamentals
Then [1] and [2]
Drag options to blanks, or click blank then click option'
Athe user sees the dashboard
Bthe login is successful
Cthe error message is shown
Dthe page reloads
Attempts:
3 left
💡 Hint
Common Mistakes
Using unrelated or contradictory outcomes.
Mixing multiple actions instead of results.
5fill in blank
hard

Fill all three blanks to complete a BDD scenario outline with placeholders.

Testing Fundamentals
Scenario Outline: [1]
Given [2]
When [3]
Drag options to blanks, or click blank then click option'
ASuccessful login with valid credentials
Bthe user navigates to the login page
Cthe user enters <username> and <password>
Dthe system crashes
Attempts:
3 left
💡 Hint
Common Mistakes
Using code or unrelated text in scenario steps.
Not using placeholders in Scenario Outline.