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 TestISTQBAdvancedPaths(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Chrome()
self.driver.get('https://www.istqb.org/certification-paths/advanced-level.html')
def test_paths_page_loads_and_links(self):
driver = self.driver
wait = WebDriverWait(driver, 10)
# Wait for main heading
heading = wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, 'h1.page-title')))
self.assertEqual(heading.text.strip(), 'ISTQB® Advanced Level Certification Paths')
# Check presence of main certification paths list
paths_list = driver.find_elements(By.CSS_SELECTOR, 'div.certification-paths ul li')
self.assertGreaterEqual(len(paths_list), 3, 'Expected at least 3 certification paths')
# Click on the first path link and verify navigation
first_path_link = paths_list[0].find_element(By.TAG_NAME, 'a')
first_path_link.click()
# Wait for syllabus page heading
syllabus_heading = wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, 'h1.page-title')))
self.assertIn('Syllabus', syllabus_heading.text)
def tearDown(self):
self.driver.quit()
if __name__ == '__main__':
unittest.main()