0
0
Testing Fundamentalstesting~10 mins

Exploratory testing in Testing Fundamentals - Test Execution Trace

Choose your learning style9 modes available
Test Overview

This test explores a simple login page without a fixed script. It tries different inputs and checks if the login button behaves correctly, verifying the system handles inputs as expected.

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 TestLoginExploratory(unittest.TestCase):
    def setUp(self):
        self.driver = webdriver.Chrome()
        self.driver.get('https://example.com/login')

    def test_login_button_enabled_with_input(self):
        driver = self.driver
        wait = WebDriverWait(driver, 10)

        # Find username and password fields
        username = wait.until(EC.presence_of_element_located((By.ID, 'username')))
        password = driver.find_element(By.ID, 'password')
        login_button = driver.find_element(By.ID, 'login-btn')

        # Initially, login button should be disabled
        self.assertFalse(login_button.is_enabled())

        # Enter username only
        username.send_keys('testuser')
        self.assertFalse(login_button.is_enabled())

        # Enter password
        password.send_keys('password123')

        # Now login button should be enabled
        self.assertTrue(login_button.is_enabled())

        # Clear username to test edge case
        username.clear()
        self.assertFalse(login_button.is_enabled())

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

if __name__ == '__main__':
    unittest.main()
Execution Trace - 7 Steps
StepActionSystem StateAssertionResult
1Test starts and opens Chrome browserBrowser opened at https://example.com/login showing login form with username, password fields and disabled login button-PASS
2Waits for username field to be present and finds password and login button elementsAll elements are visible and interactable-PASS
3Checks that login button is initially disabledLogin button is disabledAssert login_button.is_enabled() is FalsePASS
4Enters 'testuser' in username fieldUsername field contains 'testuser', password empty, login button still disabledAssert login_button.is_enabled() is FalsePASS
5Enters 'password123' in password fieldUsername and password fields filled, login button enabledAssert login_button.is_enabled() is TruePASS
6Clears username fieldUsername empty, password filled, login button disabledAssert login_button.is_enabled() is FalsePASS
7Test ends and browser closesBrowser closed-PASS
Failure Scenario
Failing Condition: Login button remains enabled even when username or password fields are empty
Execution Trace Quiz - 3 Questions
Test your understanding
What does the test check after entering only the username?
ALogin button remains disabled
BLogin button becomes enabled
CPassword field is cleared
DPage reloads
Key Result
Exploratory testing involves trying different inputs and observing system behavior without a fixed script, helping find unexpected issues.