Bird
Raised Fist0
Testing Fundamentalstesting~10 mins

Test case components (steps, expected, actual) in Testing Fundamentals - Test Execution Trace

Choose your learning style10 modes available
Test Overview

This test case checks the login functionality of a website. It verifies that when a user enters valid credentials, they successfully log in and see a welcome message.

Test Code - Selenium
Testing Fundamentals
def test_login_success():
    # Step 1: Open login page
    driver.get('https://example.com/login')

    # Step 2: Enter username
    username_field = driver.find_element(By.ID, 'username')
    username_field.send_keys('validUser')

    # Step 3: Enter password
    password_field = driver.find_element(By.ID, 'password')
    password_field.send_keys('validPass123')

    # Step 4: Click login button
    login_button = driver.find_element(By.ID, 'loginBtn')
    login_button.click()

    # Step 5: Verify welcome message
    welcome_message = WebDriverWait(driver, 10).until(
        EC.presence_of_element_located((By.ID, 'welcomeMsg'))
    )
    assert welcome_message.text == 'Welcome, validUser!', 'Welcome message did not match expected text'
Execution Trace - 5 Steps
StepActionSystem StateAssertionResult
1Open the login page URLBrowser navigates to https://example.com/login showing the login form—PASS
2Find username input field and enter 'validUser'Username field is filled with 'validUser'—PASS
3Find password input field and enter 'validPass123'Password field is filled with 'validPass123'—PASS
4Find and click the login buttonLogin button clicked, page starts loading user dashboard—PASS
5Wait for welcome message element and verify its textWelcome message 'Welcome, validUser!' is displayed on the dashboardCheck that welcome message text equals 'Welcome, validUser!'PASS
Failure Scenario
Failing Condition: Welcome message element does not appear or text is different
Execution Trace Quiz - 3 Questions
Test your understanding
What is the expected result after clicking the login button?
AAn error message about invalid credentials appears
BUser is redirected to the login page again
CUser sees a welcome message with their username
DThe browser closes automatically
Key Result
Always clearly define test steps, expected results, and actual results to make debugging easier and ensure test reliability.

Practice

(1/5)
1. Which component of a test case describes the actions a tester must perform?
easy
A. Test steps
B. Expected results
C. Actual results
D. Test summary

Solution

  1. Step 1: Understand test case components

    Test cases have steps, expected results, and actual results.
  2. Step 2: Identify which describes actions

    Test steps tell the tester what to do, the actions to perform.
  3. Final Answer:

    Test steps -> Option A
  4. Quick Check:

    Actions = Test steps [OK]
Hint: Steps = actions to perform in test case [OK]
Common Mistakes:
  • Confusing expected results with steps
  • Thinking actual results describe actions
  • Mixing test summary with steps
2. Which of the following is the correct way to write the expected result in a test case?
easy
A. User clicks the login button and waits.
B. Click the login button to open the login page.
C. Login page appears sometimes after clicking.
D. The system should display the login page after clicking the login button.

Solution

  1. Step 1: Identify expected result format

    Expected results describe what should happen clearly and precisely.
  2. Step 2: Compare options

    The system should display the login page after clicking the login button. clearly states the expected system behavior after an action.
  3. Final Answer:

    The system should display the login page after clicking the login button. -> Option D
  4. Quick Check:

    Expected result = clear system behavior [OK]
Hint: Expected result = clear, precise system behavior [OK]
Common Mistakes:
  • Writing steps instead of expected results
  • Being vague or uncertain in expected results
  • Mixing user actions with expected outcomes
3. Given this test case snippet:
Steps: 1. Enter username 'user1'
2. Enter password 'pass123'
3. Click 'Submit'
Expected: User is logged in and dashboard appears
Actual: Error message 'Invalid credentials'

What does this test result indicate?
medium
A. Test failed due to incorrect actual result
B. Expected result is wrong
C. Test steps are incomplete
D. Test passed successfully

Solution

  1. Step 1: Compare expected and actual results

    Expected is successful login; actual shows error message.
  2. Step 2: Determine test outcome

    Mismatch means test failed due to unexpected actual result.
  3. Final Answer:

    Test failed due to incorrect actual result -> Option A
  4. Quick Check:

    Expected ≠ Actual = Fail [OK]
Hint: If actual ≠ expected, test fails [OK]
Common Mistakes:
  • Assuming test passed despite different actual result
  • Confusing steps with results
  • Ignoring error messages in actual results
4. A tester wrote this test case:
Steps: 1. Open app
2. Click 'Settings'
Expected: Settings page opens
Actual: Settings page opens

But the test is marked as failed. What is the most likely error?
medium
A. Steps are missing details
B. Actual result was not recorded correctly
C. Expected result is unclear
D. Test case lacks test data

Solution

  1. Step 1: Check expected vs actual results

    Both say settings page opens, so results match.
  2. Step 2: Consider why test marked failed

    If test failed despite matching results, actual result might be recorded incorrectly or test status set wrongly.
  3. Final Answer:

    Actual result was not recorded correctly -> Option B
  4. Quick Check:

    Matching results but fail = recording error [OK]
Hint: Matching expected and actual means test should pass [OK]
Common Mistakes:
  • Assuming missing steps cause fail here
  • Confusing unclear expected with fail reason
  • Ignoring test status errors
5. You have a test case with these components:
Steps: 1. Add item to cart
2. Proceed to checkout
Expected: Total price updates correctly
Actual: Total price remains unchanged

How should you update the test case to better capture the issue?
hard
A. Remove actual result to avoid confusion
B. Change expected result to match actual price
C. Add detailed steps to verify price calculation and record exact actual price
D. Skip the test since actual differs from expected

Solution

  1. Step 1: Analyze test case problem

    Actual result shows a bug: price not updating as expected.
  2. Step 2: Improve test case details

    Adding detailed steps and exact actual price helps reproduce and fix the bug.
  3. Final Answer:

    Add detailed steps to verify price calculation and record exact actual price -> Option C
  4. Quick Check:

    More detail = better bug capture [OK]
Hint: Add details and exact actual results to clarify bugs [OK]
Common Mistakes:
  • Changing expected to hide bugs
  • Removing actual results loses evidence
  • Skipping tests hides problems
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