Bird
Raised Fist0
Testing Fundamentalstesting~15 mins

Testing in Scrum sprints in Testing Fundamentals - Build an Automation Script

Choose your learning style10 modes available
Verify feature functionality within a Scrum sprint
Preconditions (2)
Step 1: Open the application in the test environment.
Step 2: Navigate to the feature page as described in the user story.
Step 3: Perform the main actions described in the user story (e.g., fill form, submit data).
Step 4: Observe the system response and behavior.
Step 5: Report any defects found or mark the feature as passed if no issues.
✅ Expected Result: The feature works as described in the user story without errors or unexpected behavior.
Automation Requirements - Selenium with Python
Assertions Needed:
Verify the feature page loads successfully.
Verify the main actions complete without errors.
Verify the expected success message or result appears.
Best Practices:
Use explicit waits to handle dynamic page elements.
Use Page Object Model to organize locators and actions.
Keep test steps clear and simple to match manual test case.
Use meaningful assertion messages.
Automated Solution
Testing Fundamentals
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import unittest

class FeatureTest(unittest.TestCase):
    def setUp(self):
        self.driver = webdriver.Chrome()
        self.driver.get('https://test-environment.example.com/feature')
        self.wait = WebDriverWait(self.driver, 10)

    def test_feature_functionality(self):
        driver = self.driver
        wait = self.wait

        # Wait for feature page main element to load
        main_element = wait.until(EC.visibility_of_element_located((By.ID, 'feature-main')))
        self.assertTrue(main_element.is_displayed(), 'Feature main element should be visible')

        # Perform main action: fill input and submit
        input_field = driver.find_element(By.ID, 'input-data')
        input_field.clear()
        input_field.send_keys('Test data')

        submit_button = driver.find_element(By.ID, 'submit-btn')
        submit_button.click()

        # Wait for success message
        success_msg = wait.until(EC.visibility_of_element_located((By.ID, 'success-msg')))
        self.assertEqual(success_msg.text, 'Submission successful', 'Success message should appear')

    def tearDown(self):
        self.driver.quit()

if __name__ == '__main__':
    unittest.main()

This test script uses Selenium with Python's unittest framework to automate the manual test case.

setUp() opens the browser and navigates to the feature page in the test environment.

The test test_feature_functionality waits explicitly for the main feature element to appear to ensure the page loaded correctly.

It then fills the input field with test data and clicks the submit button to perform the main action.

After submission, it waits for the success message and asserts that the message text matches the expected result.

tearDown() closes the browser after the test.

This structure follows best practices: explicit waits avoid timing issues, clear assertions verify expected outcomes, and the code is easy to read and maintain.

Common Mistakes - 3 Pitfalls
Using fixed sleep times instead of explicit waits
Hardcoding locators that are brittle or unclear
Not verifying the expected result after actions
Bonus Challenge

Now add data-driven testing with 3 different input values for the feature input field.

Show Hint

Practice

(1/5)
1. In Scrum sprints, when is testing typically performed?
easy
A. Before the sprint starts
B. Only after the entire project is completed
C. During the sprint alongside development
D. Only during the sprint review meeting

Solution

  1. Step 1: Understand Scrum sprint workflow

    Scrum promotes continuous integration and testing within each sprint to catch issues early.
  2. Step 2: Identify testing timing

    Testing is done during the sprint, not after, to ensure quality and quick feedback.
  3. Final Answer:

    During the sprint alongside development -> Option C
  4. Quick Check:

    Testing inside sprint = During the sprint alongside development [OK]
Hint: Testing happens during sprint, not after [OK]
Common Mistakes:
  • Thinking testing is only after project completion
  • Assuming testing is before sprint starts
  • Confusing sprint review with testing phase
2. Which of the following is the correct way to describe the role of testers in Scrum sprints?
easy
A. Testers collaborate closely with developers and product owners
B. Testers work independently after developers finish coding
C. Testers only write test cases but do not execute them
D. Testers are not involved until the sprint retrospective

Solution

  1. Step 1: Review Scrum team collaboration

    Scrum encourages cross-functional teams where testers, developers, and product owners work together.
  2. Step 2: Identify tester involvement

    Testers actively collaborate during the sprint, not isolated or delayed.
  3. Final Answer:

    Testers collaborate closely with developers and product owners -> Option A
  4. Quick Check:

    Tester collaboration = Testers collaborate closely with developers and product owners [OK]
Hint: Testers collaborate closely in Scrum teams [OK]
Common Mistakes:
  • Believing testers work only after coding is done
  • Thinking testers only write but don't run tests
  • Assuming testers join only at sprint end
3. Consider this scenario in a Scrum sprint:
Bug found during testing on day 3 is fixed on day 4.
Testing continues on day 5 with the fix verified.
What is the main benefit of this approach?
medium
A. Delays the sprint completion
B. Keeps the product healthy by fixing bugs quickly
C. Increases the number of bugs
D. Reduces collaboration between team members

Solution

  1. Step 1: Analyze bug fixing timing

    Fixing bugs quickly within the sprint prevents accumulation of defects.
  2. Step 2: Understand impact on product health

    Quick fixes keep the product stable and maintain quality throughout development.
  3. Final Answer:

    Keeps the product healthy by fixing bugs quickly -> Option B
  4. Quick Check:

    Quick bug fixes = Keeps the product healthy by fixing bugs quickly [OK]
Hint: Fix bugs fast to keep product healthy [OK]
Common Mistakes:
  • Thinking quick fixes delay sprint
  • Assuming bug fixes increase bugs
  • Believing quick fixes reduce teamwork
4. A Scrum team notices that bugs are piling up and not fixed during the sprint. What is the most likely cause?
medium
A. Testers are fixing bugs immediately as they find them
B. Sprint backlog is updated regularly
C. Developers and testers collaborate closely
D. Testing is done only after the sprint ends

Solution

  1. Step 1: Identify testing timing problem

    If testing happens only after sprint ends, bugs accumulate without timely fixes.
  2. Step 2: Understand impact on bug backlog

    Delayed testing causes bug pile-up, harming sprint goals and product quality.
  3. Final Answer:

    Testing is done only after the sprint ends -> Option D
  4. Quick Check:

    Delayed testing = Testing is done only after the sprint ends [OK]
Hint: Bugs pile up if testing delayed after sprint [OK]
Common Mistakes:
  • Assuming immediate bug fixing causes pile-up
  • Thinking collaboration causes bugs to pile
  • Believing backlog updates cause bug accumulation
5. During a Scrum sprint, the team wants to improve product quality by integrating testing and development. Which practice best supports this goal?
hard
A. Developers and testers collaborate daily to fix bugs quickly
B. Testers write test cases after the sprint is complete
C. Testing is postponed until the sprint review
D. Product owner tests the product alone at the end

Solution

  1. Step 1: Identify collaboration benefits in Scrum

    Daily collaboration between developers and testers helps catch and fix bugs early.
  2. Step 2: Evaluate timing of testing activities

    Integrating testing during the sprint ensures continuous quality improvement.
  3. Final Answer:

    Developers and testers collaborate daily to fix bugs quickly -> Option A
  4. Quick Check:

    Daily collaboration = Developers and testers collaborate daily to fix bugs quickly [OK]
Hint: Daily dev-tester collaboration improves quality [OK]
Common Mistakes:
  • Delaying test case writing until sprint end
  • Postponing testing to sprint review
  • Relying only on product owner for testing
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