Why non-functional quality affects user experience in Testing Fundamentals - Automation Benefits in Action
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 time class LoginPage: def __init__(self, driver): self.driver = driver self.username_input = (By.ID, 'username') self.password_input = (By.ID, 'password') self.login_button = (By.ID, 'loginBtn') def login(self, username, password): self.driver.find_element(*self.username_input).clear() self.driver.find_element(*self.username_input).send_keys(username) self.driver.find_element(*self.password_input).clear() self.driver.find_element(*self.password_input).send_keys(password) self.driver.find_element(*self.login_button).click() class DashboardPage: def __init__(self, driver): self.driver = driver self.dashboard_header = (By.ID, 'dashboardHeader') def is_loaded(self): return WebDriverWait(self.driver, 10).until( EC.visibility_of_element_located(self.dashboard_header) ) class FormPage: def __init__(self, driver): self.driver = driver self.input_field = (By.ID, 'inputField') self.submit_button = (By.ID, 'submitBtn') self.error_message = (By.ID, 'errorMsg') def enter_invalid_data(self): self.driver.find_element(*self.input_field).clear() self.driver.find_element(*self.input_field).send_keys('invalid_data!') self.driver.find_element(*self.submit_button).click() def get_error_message(self): return WebDriverWait(self.driver, 5).until( EC.visibility_of_element_located(self.error_message) ).text def test_application_responsiveness_and_error_handling(): options = webdriver.ChromeOptions() # Enable network throttling via DevTools protocol driver = webdriver.Chrome(options=options) driver.get('https://example-app.com/login') login_page = LoginPage(driver) dashboard_page = DashboardPage(driver) form_page = FormPage(driver) # Normal network test start_time = time.time() login_page.login('testuser', 'password123') dashboard_page.is_loaded() load_time_normal = time.time() - start_time assert load_time_normal <= 3, f'Dashboard load time too high: {load_time_normal}s' # Simulate slow network (example using Chrome DevTools Protocol) driver.execute_cdp_cmd('Network.enable', {}) driver.execute_cdp_cmd('Network.emulateNetworkConditions', { 'offline': False, 'latency': 2000, # 2 seconds latency 'downloadThroughput': 500 * 1024 / 8, # 500 kbps 'uploadThroughput': 500 * 1024 / 8 }) driver.get('https://example-app.com/login') start_time = time.time() login_page.login('testuser', 'password123') dashboard_page.is_loaded() load_time_slow = time.time() - start_time assert load_time_slow <= 6, f'Dashboard load time too high under slow network: {load_time_slow}s' # Reset network conditions driver.execute_cdp_cmd('Network.disable', {}) # Test error handling driver.get('https://example-app.com/form') form_page.enter_invalid_data() error_text = form_page.get_error_message() assert 'invalid' in error_text.lower(), 'Error message not user-friendly or missing' # Check application responsiveness after error try: driver.find_element(*form_page.input_field).is_enabled() responsive = True except Exception: responsive = False assert responsive, 'Application not responsive after error' driver.quit()
This test script uses Selenium with Python to automate the manual test case steps.
We define Page Object classes for the login page, dashboard, and form page to keep locators and actions organized and reusable.
The test function opens the login page, performs login, and measures the time taken for the dashboard to load using explicit waits to ensure the page is ready.
It asserts that the load time is within acceptable limits under normal and simulated slow network conditions. Network throttling is done using Chrome DevTools Protocol commands.
Then it navigates to a form page, enters invalid data to trigger an error, and verifies the error message is displayed and user-friendly.
Finally, it checks that the application remains responsive after the error by verifying the input field is enabled.
Explicit waits avoid flaky tests, and assertions check both timing and content to ensure good user experience related to non-functional quality.
Now add data-driven testing with 3 different user credentials and invalid inputs to verify consistent behavior.
Practice
Solution
Step 1: Understand non-functional qualities
Non-functional qualities describe how software performs, like speed or security, not what it does.Step 2: Identify the example related to performance
Speed of response is a classic non-functional quality affecting user experience.Final Answer:
How fast the software responds to user actions -> Option CQuick Check:
Non-functional quality = speed [OK]
- Confusing features (functional) with qualities (non-functional)
- Thinking UI colors are always non-functional
- Assuming programming language affects user experience directly
Solution
Step 1: Recall what non-functional requirements are
They describe qualities like performance, security, usability, not specific features or steps.Step 2: Match the correct description
Performance and security standards fit non-functional requirements perfectly.Final Answer:
It defines the system's performance and security standards. -> Option AQuick Check:
Non-functional requirement = performance/security [OK]
- Confusing functional steps with non-functional requirements
- Thinking programming language details are requirements
- Mixing features with quality standards
Solution
Step 1: Identify the issues described
Slow loading relates to performance; crashing relates to reliability.Step 2: Match issues to non-functional qualities
Performance means speed; reliability means stability under load.Final Answer:
Performance and reliability -> Option BQuick Check:
Slow + crash = performance + reliability [OK]
- Confusing usability with performance
- Mixing security with crashing issues
- Assuming functionality covers speed problems
Solution
Step 1: Analyze user complaints
Confusing navigation relates to usability; security warnings relate to security.Step 2: Identify matching non-functional qualities
Usability means ease of use; security means protection from threats.Final Answer:
Usability and security -> Option DQuick Check:
Navigation + warnings = usability + security [OK]
- Focusing on performance instead of usability
- Ignoring security warnings as minor issues
- Mixing functionality with usability
Solution
Step 1: Understand user complaints impact
Battery drain affects usability and user satisfaction; freezing affects reliability and stability.Step 2: Decide testing priorities
Improving battery usage and stability directly improves user experience before adding features.Step 3: Eliminate incorrect options
Adding features or ignoring battery issues worsens experience; freezing relates to performance, not just security.Final Answer:
Focus on battery usage and stability tests before adding new features -> Option AQuick Check:
Battery + freeze = test usage + stability first [OK]
- Prioritizing new features over fixing core issues
- Ignoring battery drain as unimportant
- Misunderstanding freezing as only a security problem
Ready to prove it?
Pass the test and this pattern moves unknown
