0
0
Testing Fundamentalstesting~15 mins

ISTQB Advanced Level paths in Testing Fundamentals - Build an Automation Script

Choose your learning style9 modes available
Verify navigation through ISTQB Advanced Level certification paths
Preconditions (1)
Step 1: Locate the Advanced Level certification section
Step 2: Click on the 'Test Analyst' path link
Step 3: Verify the Test Analyst path details page loads
Step 4: Navigate back to the Advanced Level section
Step 5: Click on the 'Test Manager' path link
Step 6: Verify the Test Manager path details page loads
Step 7: Navigate back to the Advanced Level section
Step 8: Click on the 'Technical Test Analyst' path link
Step 9: Verify the Technical Test Analyst path details page loads
✅ Expected Result: Each Advanced Level certification path link navigates to the correct details page with relevant information displayed
Automation Requirements - Selenium with Python
Assertions Needed:
Verify page URL contains expected path identifier after clicking each link
Verify presence of key elements on each certification path details page
Best Practices:
Use explicit waits to wait for elements to be clickable or visible
Use Page Object Model to separate page structure from test logic
Use meaningful locators such as IDs or stable CSS selectors
Avoid hardcoded sleeps
Include clear assertion 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

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.

Common Mistakes - 4 Pitfalls
Using hardcoded sleep instead of explicit waits
Using brittle XPath locators that break easily
Not verifying the page loaded after clicking a link
Not closing the browser after test
Bonus Challenge

Now add data-driven testing with 3 different certification path links and their expected URL parts

Show Hint