0
0
Testing Fundamentalstesting~15 mins

ISTQB Foundation Level overview in Testing Fundamentals - Build an Automation Script

Choose your learning style9 modes available
Verify ISTQB Foundation Level syllabus topics presence on the overview page
Preconditions (2)
Step 1: Open the ISTQB Foundation Level overview page URL
Step 2: Check that the page title contains 'ISTQB Foundation Level'
Step 3: Verify that the following syllabus topics are listed on the page:
Step 4: - Fundamentals of Testing
Step 5: - Testing Throughout the Software Life Cycle
Step 6: - Static Techniques
Step 7: - Test Design Techniques
Step 8: - Test Management
Step 9: - Tool Support for Testing
✅ Expected Result: The page title contains 'ISTQB Foundation Level' and all listed syllabus topics are visible on the page
Automation Requirements - Selenium with Python
Assertions Needed:
Page title contains 'ISTQB Foundation Level'
Each syllabus topic text is present and visible on the page
Best Practices:
Use explicit waits to ensure elements are loaded before checking
Use clear and maintainable locators (e.g., By.XPATH or By.CSS_SELECTOR with text matching)
Structure code for readability and reuse
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

def test_istqb_foundation_overview():
    driver = webdriver.Chrome()
    wait = WebDriverWait(driver, 10)
    try:
        driver.get('https://www.istqb.org/certification-path-root/foundation-level.html')

        # Wait for title to contain expected text
        wait.until(EC.title_contains('ISTQB Foundation Level'))
        assert 'ISTQB Foundation Level' in driver.title, f"Title does not contain expected text. Actual title: {driver.title}"

        syllabus_topics = [
            'Fundamentals of Testing',
            'Testing Throughout the Software Life Cycle',
            'Static Techniques',
            'Test Design Techniques',
            'Test Management',
            'Tool Support for Testing'
        ]

        for topic in syllabus_topics:
            # Wait for each topic text to be visible on the page
            wait.until(EC.visibility_of_element_located((By.XPATH, f"//*[contains(text(), '{topic}')]")))
            element = driver.find_element(By.XPATH, f"//*[contains(text(), '{topic}')]" )
            assert element.is_displayed(), f"Topic '{topic}' is not visible on the page"

    finally:
        driver.quit()

This test script uses Selenium WebDriver with Python to automate the manual test case.

First, it opens the ISTQB Foundation Level overview page URL.

It waits explicitly until the page title contains the expected text to ensure the page is loaded.

Then, it checks that each syllabus topic text is present and visible on the page by locating elements containing the topic text using XPath with contains(text(), ...).

Assertions confirm the page title and each topic's visibility.

Explicit waits help avoid flaky tests by waiting for elements to appear before interacting.

The driver is closed in a finally block to ensure cleanup.

Common Mistakes - 3 Pitfalls
{'mistake': 'Using hardcoded sleep (time.sleep) instead of explicit waits', 'why_bad': 'Hardcoded sleeps slow down tests and can cause flaky failures if the page loads slower or faster than expected.', 'correct_approach': "Use Selenium's explicit waits (WebDriverWait with expected_conditions) to wait for elements or conditions dynamically."}
Using brittle locators like absolute XPath
Not verifying element visibility before asserting
Bonus Challenge

Now add data-driven testing with 3 different ISTQB syllabus URLs to verify their overview pages

Show Hint