Test Overview
This test checks if the automation framework type selection page loads correctly and verifies the presence of framework options like Data-Driven, Keyword-Driven, and Hybrid frameworks.
This test checks if the automation framework type selection page loads correctly and verifies the presence of framework options like Data-Driven, Keyword-Driven, and Hybrid frameworks.
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 TestFrameworkTypesPage(unittest.TestCase): def setUp(self): self.driver = webdriver.Chrome() self.driver.get('https://example.com/automation-frameworks') def test_framework_options_present(self): driver = self.driver wait = WebDriverWait(driver, 10) # Wait for the main container to load container = wait.until(EC.presence_of_element_located((By.ID, 'framework-options'))) # Check for Data-Driven option data_driven = driver.find_element(By.XPATH, "//li[contains(text(), 'Data-Driven')]" ) self.assertTrue(data_driven.is_displayed()) # Check for Keyword-Driven option keyword_driven = driver.find_element(By.XPATH, "//li[contains(text(), 'Keyword-Driven')]" ) self.assertTrue(keyword_driven.is_displayed()) # Check for Hybrid option hybrid = driver.find_element(By.XPATH, "//li[contains(text(), 'Hybrid')]" ) self.assertTrue(hybrid.is_displayed()) def tearDown(self): self.driver.quit() if __name__ == '__main__': unittest.main()
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts and opens Chrome browser | Browser window opens with blank page | - | PASS |
| 2 | Navigates to 'https://example.com/automation-frameworks' | Page loads with framework options container visible | - | PASS |
| 3 | Waits up to 10 seconds for element with ID 'framework-options' to be present | Element found and visible on page | Presence of main container verified | PASS |
| 4 | Finds list item containing text 'Data-Driven' | Data-Driven option visible in list | Data-Driven option is displayed | PASS |
| 5 | Finds list item containing text 'Keyword-Driven' | Keyword-Driven option visible in list | Keyword-Driven option is displayed | PASS |
| 6 | Finds list item containing text 'Hybrid' | Hybrid option visible in list | Hybrid option is displayed | PASS |
| 7 | Test ends and browser closes | Browser window closed | - | PASS |