0
0
Testing Fundamentalstesting~15 mins

Testing career progression in Testing Fundamentals - Build an Automation Script

Choose your learning style9 modes available
Verify Testing Career Progression Information Display
Preconditions (1)
Step 1: Open the Testing Career Progression webpage
Step 2: Locate the section titled 'Career Levels in Testing'
Step 3: Verify that the section lists at least three career levels: 'Junior Tester', 'Senior Tester', 'Test Lead'
Step 4: Click on the 'Senior Tester' career level to expand details
Step 5: Verify that the details include responsibilities and required skills
Step 6: Locate the 'Next Steps' section
Step 7: Verify that it provides guidance on how to advance from Junior to Senior Tester
✅ Expected Result: The Testing Career Progression page displays clear career levels with detailed information and guidance on advancement steps
Automation Requirements - Selenium with Python
Assertions Needed:
Verify presence of career levels text
Verify details expand on clicking 'Senior Tester'
Verify guidance text in 'Next Steps' section
Best Practices:
Use explicit waits to wait for elements to be visible
Use descriptive locators like By.ID or By.CSS_SELECTOR
Structure code with setup and teardown methods
Use assertions with clear 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 TestCareerProgressionPage(unittest.TestCase):
    def setUp(self):
        self.driver = webdriver.Chrome()
        self.driver.get('https://example.com/testing-career-progression')
        self.wait = WebDriverWait(self.driver, 10)

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

        # Wait for the career levels section
        career_section = wait.until(EC.visibility_of_element_located((By.ID, 'career-levels')))

        # Verify career levels text
        career_levels_text = career_section.text
        self.assertIn('Junior Tester', career_levels_text, 'Junior Tester level missing')
        self.assertIn('Senior Tester', career_levels_text, 'Senior Tester level missing')
        self.assertIn('Test Lead', career_levels_text, 'Test Lead level missing')

        # Click Senior Tester to expand details
        senior_tester_element = career_section.find_element(By.XPATH, ".//div[contains(text(), 'Senior Tester')]")
        senior_tester_element.click()

        # Verify details appear
        details = wait.until(EC.visibility_of_element_located((By.ID, 'senior-tester-details')))
        details_text = details.text
        self.assertIn('responsibilities', details_text.lower(), 'Responsibilities missing in Senior Tester details')
        self.assertIn('skills', details_text.lower(), 'Skills missing in Senior Tester details')

        # Verify Next Steps section
        next_steps = wait.until(EC.visibility_of_element_located((By.ID, 'next-steps')))
        next_steps_text = next_steps.text
        self.assertIn('advance from Junior to Senior Tester', next_steps_text, 'Advancement guidance missing')

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

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

This test script uses Selenium with Python and unittest framework.

In setUp, it opens the Testing Career Progression page and sets an explicit wait.

The test test_career_progression_display waits for the career levels section to appear, then checks that the expected career levels text is present.

It clicks the 'Senior Tester' element to expand details, then waits for and verifies that the details contain 'responsibilities' and 'skills'.

Finally, it checks the 'Next Steps' section for guidance text on advancing from Junior to Senior Tester.

Explicit waits ensure elements are ready before interacting, and assertions have clear messages to help identify failures.

The tearDown method closes the browser after the test.

Common Mistakes - 3 Pitfalls
Using time.sleep() instead of explicit waits
Using brittle XPath selectors with absolute paths
Not verifying that details expanded after clicking
Bonus Challenge

Now add data-driven testing with 3 different career levels to verify their details expand correctly

Show Hint