Testing in Scrum sprints in Testing Fundamentals - Build an Automation Script
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.
Now add data-driven testing with 3 different input values for the feature input field.
Practice
Solution
Step 1: Understand Scrum sprint workflow
Scrum promotes continuous integration and testing within each sprint to catch issues early.Step 2: Identify testing timing
Testing is done during the sprint, not after, to ensure quality and quick feedback.Final Answer:
During the sprint alongside development -> Option CQuick Check:
Testing inside sprint = During the sprint alongside development [OK]
- Thinking testing is only after project completion
- Assuming testing is before sprint starts
- Confusing sprint review with testing phase
Solution
Step 1: Review Scrum team collaboration
Scrum encourages cross-functional teams where testers, developers, and product owners work together.Step 2: Identify tester involvement
Testers actively collaborate during the sprint, not isolated or delayed.Final Answer:
Testers collaborate closely with developers and product owners -> Option AQuick Check:
Tester collaboration = Testers collaborate closely with developers and product owners [OK]
- Believing testers work only after coding is done
- Thinking testers only write but don't run tests
- Assuming testers join only at sprint end
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?Solution
Step 1: Analyze bug fixing timing
Fixing bugs quickly within the sprint prevents accumulation of defects.Step 2: Understand impact on product health
Quick fixes keep the product stable and maintain quality throughout development.Final Answer:
Keeps the product healthy by fixing bugs quickly -> Option BQuick Check:
Quick bug fixes = Keeps the product healthy by fixing bugs quickly [OK]
- Thinking quick fixes delay sprint
- Assuming bug fixes increase bugs
- Believing quick fixes reduce teamwork
Solution
Step 1: Identify testing timing problem
If testing happens only after sprint ends, bugs accumulate without timely fixes.Step 2: Understand impact on bug backlog
Delayed testing causes bug pile-up, harming sprint goals and product quality.Final Answer:
Testing is done only after the sprint ends -> Option DQuick Check:
Delayed testing = Testing is done only after the sprint ends [OK]
- Assuming immediate bug fixing causes pile-up
- Thinking collaboration causes bugs to pile
- Believing backlog updates cause bug accumulation
Solution
Step 1: Identify collaboration benefits in Scrum
Daily collaboration between developers and testers helps catch and fix bugs early.Step 2: Evaluate timing of testing activities
Integrating testing during the sprint ensures continuous quality improvement.Final Answer:
Developers and testers collaborate daily to fix bugs quickly -> Option AQuick Check:
Daily collaboration = Developers and testers collaborate daily to fix bugs quickly [OK]
- Delaying test case writing until sprint end
- Postponing testing to sprint review
- Relying only on product owner for testing
Ready to prove it?
Pass the test and this pattern moves unknown
