Junior
How will you test the input field for the name?
sobes.tech AI
Answer from AI
I will check the following:
Data Types:
- The field accepts only valid characters (letters, space).
- Absence of digits, special characters, Cyrillic (if not specified).
Length:
- Minimum allowable length (if any).
- Maximum allowable length (truncated or error message).
- Boundaries of permissible length (testing at minimum+1, maximum-1, minimum, maximum length).
Empty value:
- The field is not empty (if mandatory).
- Correct display of error message if the field is empty and mandatory.
Spaces:
- Field with spaces at the beginning, end.
- Field with multiple spaces between words.
- Field consisting only of spaces.
Case sensitivity:
- Input in different cases (lowercase, uppercase).
Copy/Paste:
- Copying from clipboard.
- Pasting from clipboard.
Interaction:
- Clicking on the field.
- Navigation through the field with keyboard (Tab, Shift+Tab).
- Correct display of placeholder.
Input boundaries (Boundary Value Analysis):
- Minimum permissible length.
- Maximum permissible length.
- Values around the boundaries (minimum - 1, minimum + 1, maximum - 1, maximum + 1).
Equivalence Partitioning:
- Correct names (letters, space).
- Incorrect names (digits, special symbols).
- Empty field.
Load testing (if necessary):
- Entering a very long name (much longer than the maximum length, if there is no restriction at the field level).
Automation testing:
- Creating test cases covering the above scenarios.
- Using frameworks (e.g., Selenium, Cypress) for interacting with the field.
- Validating client-side and server-side validation.
// Example of checking field length in Java using Selenium
WebElement nameField = driver.findElement(By.id("name"));
nameField.sendKeys("A".repeat(256)); // Assuming 255 is max length
String value = nameField.getAttribute("value");
// Check that the value was truncated or an error was displayed
# Example of checking invalid characters input in Python using Selenium
from selenium.webdriver.common.keys import Keys
name_field = driver.find_element_by_id("name")
name_field.send_keys("Иван123!@#")
# Check that the field did not accept invalid characters or displayed a message