0
0
Testing Fundamentalstesting~10 mins

Why non-functional quality affects user experience in Testing Fundamentals - Test Execution Impact

Choose your learning style9 modes available
Test Overview

This test checks if a web application meets non-functional quality standards like loading speed and responsiveness, which directly impact user experience.

Test Code - Selenium
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 TestNonFunctionalQuality(unittest.TestCase):
    def setUp(self):
        self.driver = webdriver.Chrome()
        self.driver.implicitly_wait(5)

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

        # Measure page load by waiting for main content
        WebDriverWait(driver, 10).until(
            EC.presence_of_element_located((By.ID, 'main-content'))
        )

        # Check if button is clickable quickly
        button = WebDriverWait(driver, 5).until(
            EC.element_to_be_clickable((By.ID, 'submit-btn'))
        )
        button.click()

        # Verify response message appears
        response = WebDriverWait(driver, 5).until(
            EC.visibility_of_element_located((By.ID, 'response-msg'))
        )
        self.assertEqual(response.text, 'Submission successful')

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

if __name__ == '__main__':
    unittest.main()
Execution Trace - 7 Steps
StepActionSystem StateAssertionResult
1Test starts and Chrome browser opensBrowser window is open and ready-PASS
2Navigates to https://example.comPage begins loading-PASS
3Waits up to 10 seconds for element with ID 'main-content' to appearPage main content is visiblePresence of main content elementPASS
4Waits up to 5 seconds for 'submit-btn' button to be clickableButton is clickable and ready for interactionButton is enabled and clickablePASS
5Clicks the 'submit-btn' buttonButton click triggers response-PASS
6Waits up to 5 seconds for 'response-msg' element to be visibleResponse message is displayedResponse text equals 'Submission successful'PASS
7Test ends and browser closesBrowser window closed-PASS
Failure Scenario
Failing Condition: Page takes too long to load or elements are not interactable in time
Execution Trace Quiz - 3 Questions
Test your understanding
What does the test verify about the 'submit-btn' button?
AThat it becomes clickable within 5 seconds
BThat it is visible but not clickable
CThat it is disabled
DThat it is hidden
Key Result
Testing non-functional qualities like load time and responsiveness ensures users have a smooth experience, preventing frustration from slow or unresponsive interfaces.