0
0
Testing Fundamentalstesting~10 mins

Compatibility testing in Testing Fundamentals - Test Execution Trace

Choose your learning style9 modes available
Test Overview

This test checks if a web application works correctly on different browsers and operating systems. It verifies that the main page loads and the login button is clickable on each platform.

Test Code - Selenium with unittest
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
import unittest

class CompatibilityTest(unittest.TestCase):
    def setUp(self):
        # Example: Chrome driver setup; in real tests, this would vary per browser/OS
        self.driver = webdriver.Chrome()
        self.driver.implicitly_wait(5)

    def test_main_page_loads_and_login_button(self):
        driver = self.driver
        driver.get('https://example.com')

        # Wait for main page title to be correct
        WebDriverWait(driver, 10).until(EC.title_contains('Example Domain'))

        # Find login button by accessible name
        login_button = WebDriverWait(driver, 10).until(
            EC.element_to_be_clickable((By.CSS_SELECTOR, 'button[aria-label="Login"]'))
        )

        self.assertTrue(login_button.is_displayed(), 'Login button should be visible')

    def tearDown(self):
        self.driver.quit()

if __name__ == '__main__':
    unittest.main()
Execution Trace - 6 Steps
StepActionSystem StateAssertionResult
1Test starts and Chrome browser opensChrome browser window is open and ready-PASS
2Navigates to 'https://example.com'Browser loads the Example Domain main page-PASS
3Waits until page title contains 'Example Domain'Page title is 'Example Domain'Title contains 'Example Domain'PASS
4Finds login button with aria-label 'Login' and waits until clickableLogin button is visible and enabled on the pageLogin button is clickablePASS
5Checks if login button is displayedLogin button is visible to userlogin_button.is_displayed() returns TruePASS
6Test ends and browser closesBrowser window is closed-PASS
Failure Scenario
Failing Condition: Login button is missing or not clickable on a specific browser or OS
Execution Trace Quiz - 3 Questions
Test your understanding
What does the test verify after navigating to the website?
AThe browser window size
BThe page title contains 'Example Domain'
CThe URL contains 'login'
DThe browser console has no errors
Key Result
Always verify key interactive elements are present and usable on all target browsers and operating systems to ensure compatibility.