Junior
How will you test the 'Name' field?
sobes.tech AI
Answer from AI
- Positive tests:
- Correct names (Latin, Cyrillic, mixed writing).
- Names with spaces (one in the middle, several in the middle).
- Names with hyphens.
- Names with apostrophes.
- Names of minimum and maximum allowed length.
- Negative tests:
- Empty field.
- Use of digits.
- Use of special characters (!@#$%^&*()).
- Spaces at the beginning or end of the string.
- Names exceeding maximum allowed length.
- Names containing only spaces.
- Boundaries:
- Minimum allowed length - 1 character (or other if specified).
- Maximum allowed length.
- UI/UX tests:
- Focus acquisition on transition.
- Clearing the field.
- Correct display of placeholder.
- Error message presence on incorrect input.
- Accessibility for screen readers.
- Security:
- XSS vulnerability check (e.g., input
<script>alert('XSS')</script>). - SQL injections (e.g., input
' OR '1'='1).
- XSS vulnerability check (e.g., input
- Internationalization/Localization (if applicable):
- Input of characters from other languages.
Tests also check:
- Validation error display.
- State of "Save" or "Send" button (active/inactive).
- Error logging.
For automation:
- Framework used (e.g., Selenium, Cypress).
- Test data creation (fixtures, generation).
- Tests run in CI/CD pipeline.
# Example of automation code in Selenium
from selenium.webdriver import Chrome
from selenium.webdriver.common.by import By
driver = Chrome()
driver.get("http://your-application-url")
# Find "Name" field by its locator
name_field = driver.find_element(By.ID, "nameInput")
# Positive test example
name_field.send_keys("Ivan Ivanov")
# Steps for form submit and success check
# Negative test example
name_field.clear()
name_field.send_keys("12345")
# Steps for form submit and validation error check
driver.quit()