Test Cases For Name Field, Text Box, Text Field: In this post, we’ll discuss test cases for the text field. Every web or desktop application has text input for its functionality. To test effectively, we need to understand the purpose of the text field and the input being processed.
A text field is an input element in HTML and XHTML that allows the user to enter text. It is one of the most common elements in any form, but it has some specific uses and styles that make it a great choice for user testing purposes.
A text field is a one-dimensional input element for user input. Unlike other elements, it does not have any additional semantics associated with it; therefore, its meaning must be explicitly defined to avoid misinterpretation by the user.
Post Type: | Test Case Template |
Published On: | www.softwaretestingo.com |
Applicable For: | Freshers & Experience |
Telegram Group | SoftwareTestingo Telegram Group Link |
Text fields have become an important part of the web experience. They are a standard part of every website, with many browsers providing a dedicated place to enter text. Yet they are often the worst offenders regarding usability issues, ranging from the most basic to the most complex. This article will help you understand how text fields should be designed and what they need to do for them to be truly usable.
Test Case For Name Field
Name Fields are one of the common fields of any form. So if you going as a fresher for any Testing interview, you will face a basic test case interview question: how to write test cases for the name field?
So we have decided to bring a test case about name field test cases. Before writing the test case, you have confirmed whether you are writing test cases for the first name and last name fields or any specific field. And also, in some interviews, the interviewer asks the same questions in a different way, like name field test cases, test cases for first name and last name field, test cases for the first name field, test scenarios for the name field, first name field validation test cases, name field validation test cases, test cases for the full name field first name field test cases, how to write test cases for the name field.
Ui Name Field Test Cases
- Check the name field design should be as per the customer’s specification
- The name field layout should be as per the customer’s specifications.
- Check if the name field is mandatory. Then red ” * ” should be displayed.
- Check whether placeholder text should be shown properly or not for the name field.
- Check the design of the name field is as executed or not
- Check the width of the name field
- Check the height of the name field
Functional Test Cases For First Name Field
- Check when the user clicks on the name field, the text cursor should be visible in the name field.
- Check whether the user can click on the name field or not.
- Check whether the user can type in the name field or not.
- Verify the user should be allowed to enter only alphabet characters in the name field.
- Check the user can copy text from the name field.
- Check the user can remove text from the name field.
- Check the maximum length of characters in the name field.
- Check the minimum length of characters in the name field.
- Check length with boundary values in the name field.
- Check whether the user should be able to leave a blank name field.
- Check whether entered values should be properly visible or not.
Negative Test Scenarios For Name Field
- Check that the user cannot enter numeric characters in the name field.
- Check that the user cannot enter special characters in the name field.
- The user should not be able to enter numeric special characters in the name field.
- Check the user should not able to allow space in the name field.
- The user should not be able to paste numeric or special characters in the name field.
First Name Field Validation Test Cases
- Check it should display a validation error message for the required field.
- Verify if the name field is mandatory then a red ” * ” mark should be displayed.
- Verify the validation error message should be displayed when the user enters numeric characters in the name field.
- Check validation error messages should be displayed when users enter special characters in the name field.
- Verify the validation error message should be displayed when the user enters numeric special characters in the name field.
- Check whether the user should be able to proceed with a blank field or not.
- Check the validation error message should be displayed if the user entered the maximum or upper limit of characters.
- Check the validation error message should be displayed if the user entered a minimum or lower limit of characters.
Test Cases For Text Field
Text fields are a great way to quickly get the necessary information on your screen. The text field itself doesn’t do anything fancy, but it is one of the most important elements of any form. Most forms you’ll find in use these days have a text field as part of their design.
In the interview, you may face the same test case differently, like test cases for text field, text field test cases, test scenarios for first name text field, the test case for text field, test scenarios for username text field, negative test cases for text field & test scenarios for the text field.
When we are thinking about the Text field, we must first know where these text fields are used. The common answer is that text fields are used mostly in the forms. The web form could be a login form, contact form, registration form, or any other data entry form. In the case of document-based forms, you may find such fields inside the PDF Forms.
Here are some of the text field test cases.
- Check the maximum allowed character length of the text field.
- Check the minimum allowed character length of the text field
- Check the expected character for the text field.
- Check the text field is allowing more than expected characters.
- Check if the text field allows fewer characters, as mentioned in the SRS.
- Check the text box is allowing only numbers.
- Check the text box is allowing only alphabets.
- Check the text box is allowing only decimals.
- Check the text box is allowing only formatted numbers.
- Check the text box is allowing only upper case alphabets.
- Check the text box is allowing only lowercase alphabets.
- Check the text box is allowing alphanumeric.
- Check the text box is allowing upper case and lower case alphabets.
- Check whether the special character is allowed or not in the text box.
- Check is the field allowing special operations like Check the text is the box is allowing alphanumeric HTML characters / Java Script / SQL injection.
- Check if the field allows Blank Inputs.
- Check if the text field is allowing trailing spaces or leading spaces.
- Check the text field is allowing copy-paste.
- Check if the field allows spaces.
Types of Text Field
Depending on the text field requirement in the form, the input needs to be processed accordingly.
- The name field needs only to accept the alphabet values.
- The name field should not accept numeric content.
- The name field should not accept the symbols.
- Card Number is a numeric field, and then it should only accept numbers.
- The card Number field should not accept characters and symbols in the input field.
- Forms with a Credit Card number field only accept specific numbers.
- The card number field should not accept input more than the field needs.
- The credit and Debit card number field detects the card type based on the number.
- The card number field should also detect the debit or credit card type.
- The Zip Code field should accept only alphanumeric input from the users.
- The address field should allow characters, numeric, and symbol input.
- The address field could be a single or multi-line input box.
- The address may or may not be a mandatory field.
If the text box is not specified for the input, in such a case, it can accept numeric, text, or symbols as its input. The test in such a case has to be based on the type of data that needs to be processed. For example, the Search engine accepts this type of input. However, to process such content, the search engine has an input processing system. The tests have to be made with respect to the content processing specifications.
Test Cases For Text Area
The Text Area is the container of a web page. It can be used to place content or to group-related content. There are also other methods of grouping content on a web page such as Headings, Lists, and Rows.
Text areas are regions of the web page where text can be entered and edited. These areas are usually created using an input element, a textarea, or some other HTML element. They may be used to display data from user-submitted forms, or to allow the user to change a setting on the page.
Functional Test Cases For Text Area
- Check default text is displaying inside the text area.
- Check on clicking inside the text area the default text should not display.
- Check the height & width of the text area.
- Check when you move the cursor inside the text area the arrow is changing to the insertion bar.
- Check when you enter more characters into the text area the vertical and scroll bar is appearing.
- Check if the scroll bar is appearing as per the requirement.
- Check on pasting the character the scroll bars are appearing.
- Check rich text editor options are displaying.
- Check whether users are allowed to resize the text area.
- Check whether the user can add duplicate content inside the text area.
- Check on hover over the text tool tip message is displaying.
- Check is there any validation is applied for the text area.
- Check if the keyboard functions like CTRIL+C, CTRL+V, etc are allowed inside the text area.
- Check you are able to delete by pressing the backspace key on the keyboard.
- Check user is able to type by clicking inside the text area.
- Check is clicked on the copy to clipboard, copied the same content with the same format from the result section in the text area.
- Check that HTML tags are working inside the text area.
- Check Java Script code not be implemented in the text area or the result section on click on the Submit button. For example <script>alert(“123”)</script> an alert should not be shown.
- Check if an error message is displaying on entering un-supported formatted content inside the text area.
- Check the input text area protected from the SQL injection.
- Check if the format of copied and paste content is the same.
- Check if the user copy/pastes highlighted content, then don’t display the copied content highlighted.
- Check user can paste the content by mouse inside the text area.
- Check if the total word count is displayed below the text area.
- Check after pasting content inside the text area the word count is updated.
- Check User can enter alphanumeric/alphabet/number and special characters inside the text area.
- Check the user can Lower case and Upper case alphabets are allowed.
- Check the maximum allowed character for the text area.
- Check is there any minimum content limit is applied.
- Check if an error message is displaying on clicking on the button without entering any content.
- Check by entering more content into the text area, vertical and horizontal scroll bars is appearing.
- Check the functionality of the scroll bar is working as per requirement.
- Check on paste content extra space is added.
Test Cases for Numeric Field
A numeric field is a special HTML element that is used to contain numeric data. Its main purpose is to embed numerical data into web pages. This can be numbers, dates, or any other data type. Numeric fields are the most common element in HTML forms and are supported by all major browsers.
- Check if the field is accepting numeric values by entering some numeric values.
- Check the field without entering any data into the field
- Check if the field is accepting alphabet characters.
- Check the maximum length of the field.
- Check the minimum length of the field.
- Check if the field is allowing decimal values, for example, 123.123.
- Check the field is allowing numeric values with special characters like $,#, and other special characters. For example 123,123
- Check the field by entering only 0 values.
- Check if the field allows a 0.0 value.
- Check the field is allowing spaces.
- Check the field is allowing negative and positive signs. For example +123.123 & -123.123
- Check the field is allowing blank spaces in between numbers for example 123 123
Test Cases for Alphanumeric Field
On a web page, all the text and other elements are displayed in alphanumeric fields. This means that all these elements will have the same width or some of them may be wider than others. For example, if you want to display the font size of your website in a specific manner, then you can achieve this by setting up proper dimensions for each field on your website.
- Check if the field is allowing alphanumeric values, for example, SoftwareTestingo2022
- Check if the field is allowing numbers only.
- Check the field is allowing alphabets only.
- Check if the field is allowing alphanumeric values with spaces in between them. For example Software Testingo 2022
- Check if the field is allowing only blank space.
- Check the field is allowing decimal characters.
- Check if the field is allowing special characters like !,@,#,$,%,&, and other special characters.
- Check if the field is allowing both Upper case and lower case alphabets.
- Check if the field is allowing to paste of the alphanumeric values in the field.
Test Case For Mandatory Fields
If someone asks you how to write test cases for mandatory fields, then you have to remember the basic rule is mandatory field is a part of the page where we have to fill in the data. You can not skip those fields. To Proceed to the next form or page you have to fill in the proper values those fields are marked as mandatory fields.
- Check if the mandatory fields of the application are marked with a special character like a red star icon (*).
- Try to save the mandatory field without entering any data on the fields.
- Check for the alert message when submitting the form without filling in the mandatory field.
- Check if the proper alert message is displaying or not.
- Check the field’s behavior when the user tries to submit the form without filling in the mandatory field.
- Check if the valid values are saved on the mandatory field after clicking the save or submit button.
- Check if the alert message displays when the user edits a mandatory field and leaves that mandatory field blank.
- Check for the alert message when the user submits the form by filling in some mandatory fields, but still, some are blank.
- Check if the user is saved mandatory fields by putting spaces.
- Check if the alert message displays when the user tries to paste unaccepted values.
Test Cases for GST Number Field
GST or Goods and Services Tax is a comprehensive indirect tax levied on the supply of goods and services at a national level by the Government of India. It is an effective method to increase government revenue and improve efficiency in the country’s tax administration system.
GSTIN (Goods and Services Tax Identification Number) is a 15-digit alphanumeric identification number assigned to all registered taxable entities in India. It is a permanent number assigned by the Government of India that identifies an entity liable for GST payment. It enables it to claim an input tax credit in respect of such GST paid or payable on inputs used, provided that the inputs are used about any business activity carried out by the taxable entity.
Goods and Services Taxpayer Identification Number (GSTIN). Here are important test cases for the GST number field given.
Basic GST Format: 09AABCU9603R1ZL
Valid Test cases For GSTIN
- Check the Field is allowing valid GST numbers in the field.
- Check if the error message displays when you enter an invalid GST number in the field.
- Check if the first two characters of the GST number is Numeric value.
- Check the next ten characters as the PAN number of the taxpayer.
- Verify the 13 characters will be a number from 1-9 or an alphabet.
- Check if the 14th Character should be Z.
- Check the 15th Character should be an alphabet or a number.
- Check the Field by entering mess than 15 Characters.
- Check the field is allowing more than 15 Characters.
- Check the First two characters allowing alphabets.
- Check the first two fields by entering one alphabet and one numeric value.
- Check the GST number field by filling invalid PAn number after the first two characters.
- Check the 13 Character is allowing 0.
- Check the field is allowing more than 15 Characters.
- Check that 14 characters are allowed other than Z.
How to Identify the GST number: 09AABCU9603R1ZL
Explanation:
- 09 – First two numbers represent the state code as per the Indian Census.
- AABCU9603R1 – Next ten characters represent the PAN number of the taxpayer.
- Z-It is a default value.
- L-It represents a check code. It can be a number or an alphabet.
How to verify the GST number?
To verify any GST number, follow the below step.
- Go to the official GST website i.e. https://services.gst.gov.in/services/searchtp
- Enter the GST number in the Text box
- Click on the search button
Pan Card Test Cases
A person who holds a Permanent Account Number (PAN) is known as a ‘PAN holder’. PAN Card is an identity proofing document issued by the Income Tax Department. A PAN cardholder’s number is unique in the country and linked to his/her name, address, and other information.
There are a lot of things that can be done with your PAN card. It can help you save money on taxes, tell you about tax-related dates and any information related to it, help you get bank loans, etc. A person’s PAN card is their identity document stored in the National e-governance database. This system is called PAN (Permanent Account Number) and is used for tax filing and financial transactions.
Here, some important Test cases for the pan card field were given. Pan Number Format: ABCDE1234F
Valid Test Cases
- Check by entering a valid pan number in the pan number field.
- Check if the first five characters are upper-case characters.
- Check the next four characters should be numeric characters from 0-9.
- Check the last character should be an alphabet.
- Check there should be no spaces between 10 characters.
- Check if there is any error message when entering an invalid pan card number.
- Check if the pan card field allows less than 10 characters.
- Check if the pan card number field is allowing more than 10 characters.
Test Cases for Aadhar Card
Aadhar card is an identity document that was launched by the Government of India on 6th June 2010. It is a proof of identity for every Indian citizen and a means to access various services, subsidies, benefits, and social security benefits. Every Indian Citizen must carry it with them at all times. The card has biometric data like fingerprints, Eye scans, and photos as well as demographic details such as age, gender, etc.
Aadhar card is a unique identity project of the Government of India which enables the Unique Identification Authority of India (UIDAI) to maintain a database with your demographic and biometric information. In simple words, the Aadhaar card is a 12-digit identification number issued by UIDAI to individuals and their agencies.
- Check the Aadhar card field by entering 12-digit characters. Eg. 1234-1234-1234
- Check the maximum character allowed in the Aaadhar card field.
- Check the minimum character allowed in the aadhar card field.
- Check if the Aadhar card field is allowing Alphabets.
- Check if the Aadhar card field is allowing special characters.
- Check error message is displayed on entering an invalid aadhar number.
- Check if the error message is as per the requirement.
- Check if the field is allowing blank spaces.
- Check if the field allows 12 digits all Zero (0).
Test Cases For Passport Number
A passport is an identity document issued by the government of a country. A passport is a document that guarantees your identity, nationality, and citizenship. It allows you to move freely in the world and enjoy privileges as a citizen of any country. If you are thinking of applying for a Passport then read this article because here we will explain what is Passport in simple words.
Here, Important test cases for the passport number field are given.
Passport Number format in India
Example – J8369815
Positive Test Cases For Passport Number
- Check the maximum allowed character for the passport number field.
- Check passport number should be 8 characters long valid number.
- Check that the first character of the passport should be in the Uppercase alphabet.
- Check that the next two characters should be a number, but the first character should be any number from 1-9 (one to nine) and the second character should be any number from 0-9.
- Check that the next four characters should be any number from 0-9.
- Check that the last character should be any number from 1-9.
- Check the error message shows or not when the user enters an invalid passport number.
- Verify whether the alert message is per requirement or not.
Negative Test Case for Passport Field
- Check the field by entering the passport number more than 8 Char.
- Check the field by entering the passport number less than 8 Char.
- Check if the field is allowing blank spaces.
- Check the passport field by entering the combination of number and blank space.
- Check the field by entering the special char.
- Check the passport field by entering the first char of the passport as the number.
- Check the Passport field by entering the alphabet only.
- Check the passport field by entering the number only.
- Verify the passport field by entering the second Char as 0(zero)
- Verify the passport field by entering the last char as 0(zero ).
- Check that when the user pastes an invalid passport number.
Test Cases for Amount Field (Currency Field)
- Check if the amount field is clickable or not.
- Check whether the user is allowed to enter a value into that field.
- Check if the field is allowing only numbers.
- Check if the field is allowing decimal values.
- Check if the field is allowing alphabetic characters.
- Check if the field is allowing special characters.
- Check if the field is allowing blank spaces between the numbers.
- Check if the field is allowing negative values.
- Check the maximum length of characters allowed by the field.
- Check the minimum length of characters allowed by the field.
- Check if the field is allowing only zero values.
- Check if the field is allowing copy-paste into the field.
- Check if the field is displaying an alert message when that field is a mandatory field.
- Check the entered value is displaying properly to the user.
Conclusion:
In this post, we have tried to share various test scenarios of Text Field, Text Area, Numeric Field, Alphanumeric Field, Mandatory Field, GST Number Field, Pan Card, Aadhar Card, Passport Number & Amount Field (CurrencyField). If you found some missing test scenarios then you can update us by commenting in the comment section.
Thanks for Sharing so many Test Cases in details
Thanks For Somany Web Elements Test Scenarios in a single place
Thanks For Sharing an Detailed Test cases on Web Page Elements, can you share excel file also.
Good test cases
Thank you sir..
Thanks for sharing these test cases .Really helpful
Thanks a bunch,sir for sharing these test cases.
Really helpful, Thanks