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.