ISTQB Advanced Level paths 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 class ISTQBAdvancedLevelPage: def __init__(self, driver): self.driver = driver self.wait = WebDriverWait(driver, 10) def open(self, url): self.driver.get(url) def click_test_analyst(self): link = self.wait.until(EC.element_to_be_clickable((By.LINK_TEXT, 'Test Analyst'))) link.click() def click_test_manager(self): link = self.wait.until(EC.element_to_be_clickable((By.LINK_TEXT, 'Test Manager'))) link.click() def click_technical_test_analyst(self): link = self.wait.until(EC.element_to_be_clickable((By.LINK_TEXT, 'Technical Test Analyst'))) link.click() def is_on_test_analyst_page(self): return 'test-analyst' in self.driver.current_url and self.wait.until( EC.presence_of_element_located((By.TAG_NAME, 'h1'))).text.lower().find('test analyst') != -1 def is_on_test_manager_page(self): return 'test-manager' in self.driver.current_url and self.wait.until( EC.presence_of_element_located((By.TAG_NAME, 'h1'))).text.lower().find('test manager') != -1 def is_on_technical_test_analyst_page(self): return 'technical-test-analyst' in self.driver.current_url and self.wait.until( EC.presence_of_element_located((By.TAG_NAME, 'h1'))).text.lower().find('technical test analyst') != -1 def navigate_back(self): self.driver.back() def test_istqb_advanced_level_paths(): driver = webdriver.Chrome() page = ISTQBAdvancedLevelPage(driver) try: page.open('https://www.istqb.org/certification-path.html') page.click_test_analyst() assert page.is_on_test_analyst_page(), 'Failed to load Test Analyst path page' page.navigate_back() page.click_test_manager() assert page.is_on_test_manager_page(), 'Failed to load Test Manager path page' page.navigate_back() page.click_technical_test_analyst() assert page.is_on_technical_test_analyst_page(), 'Failed to load Technical Test Analyst path page' finally: driver.quit() if __name__ == '__main__': test_istqb_advanced_level_paths()
This test script uses Selenium WebDriver with Python to automate navigation through the ISTQB Advanced Level certification paths.
The ISTQBAdvancedLevelPage class models the page and provides methods to click each certification path link and verify the page loaded by checking the URL and page heading.
Explicit waits ensure elements are clickable or present before interacting or asserting, avoiding flaky tests.
The test function opens the certification paths page, clicks each Advanced Level path link, verifies the correct page loads, then navigates back to repeat for the next path.
Assertions include clear messages to help identify failures.
The driver is properly closed in a finally block to clean up after the test.
Now add data-driven testing with 3 different certification path links and their expected URL parts