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 a type of 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|
|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 when it comes to 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 Cases For Text Field
Text fields are a great way to get the necessary information on your screen quickly. The text field itself doesn’t do anything fancy, but it is one of the most important elements of any form. In fact, most forms you’ll find in use these days have a text field as part of their design.
When we are thinking about the Text field, We have to know first where these text fields are used. The common answer for this is 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 test cases for the text field.
- Check the maximum alllowed character length of the text field
- Check the minimum alllowed character length of the text field
- Check what is the expected character for the text field.
- Check the text field is allowing more then expected character.
- Check is the text field is allowing less character as mentioned in the SRS.
- Check the text is box is allowing only numbers.
- Check the text is box is allowing only alphabets.
- Check the text is box is allowing only decimals.
- Check the text is box is allowing only formatted numbers.
- Check the text is box is allowing only upper case alphabets.
- Check the text is box is allowing only lower case alphabets.
- Check the text is box is allowing alphanumeric.
- Check the text is box is allowing upper case and lower case alphabets.
- Check special character is aloowing or not in the text box.
- Check is the field allowing special operation like Check the text is box is allowing alphanumeric.utting HTML characters / Java Script / SQL injection.
- Check is the field allowing Blank Inputs.
- CHeck is the text field is allowing trailing spaces or leading spaces.
- Check the text field is allowing copy paste.
- Check is the field allowing 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.
- Card Number field should not accept characters and symbols in the input field.
- Forms with Credit Card number field only accept the specific numbers.
- The card number field should not accept the input more than the field needs.
- 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.
- Zip Code field should accept only the 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 insertion bar.
- Check when you enter more character into the text area the vertical and scroll bar is appearing.
- Check is the scroll the 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 wheather users are allowing to resize the text area.
- Check weather the user can add duplicate content in side 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 is the keyboard functions like CTRIL+C, CTRL+V etc are alllowed inside the text area.
- Check you are able to delete by pressing backspace key of keyboard.
- Check user is able to type by clicking inside the text area.
- Check is click on the copy to clipboard, copied the same content with the same format from the result section in the text area.
- Check 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 is error message is displaying on enter un supported formatted content inside the text area.
- Check input text area protected from the SQL injection.
- Check is the format of copied and paste content is same.
- Check if 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 is the total word count is displaying below the text area.
- Check after paste content inside the text area the word count is updated.
- Check User can enter alphanumeric / aphabet / number and special character 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 is error message is displaying on clicking on button with out entering any content.
- Check by entering more content into the text area, vertical and horizontal scrol bar is appearing.
- Check the functionality of the scroll bar is working as per requirement.
- Check on paste content extra space is adding.
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 is the field is accepting numeric values by entering some numeric values.
- Check the field with out enetering any data into the field
- Check is the field is accepting alphabet characters.
- Check the maximum length of the field.
- Check the minimum length of the field.
- Check is the field is allowing decimal values, for example: 123.123.
- Check the field is allowing numeric value with special character like ,,$,# and other special character. For example 123,123
- Check the field by entering only 0 values.
- Check is the field allowing 0.0 value.
- Check the field is allowing spaces.
- Check the field is allowing negative and postivive sign. For example +123.123 & -123.123
- Check the field is allowing bl;ank 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 is the field is allowing alphanumeric values, for example SoftwareTestingo2022
- Check is the field is allowing numbers only.
- Check the field is allowing alphabets only.
- Check is the field is allowing alphanumeric values with spaces in between them. For example Software Testingo 2022
- Check is the field is allowing only blank space.
- Check tjhe field is allowing decimal characters.
- Check is the field is allowing special characters like !,@,#,$,%,& and other special characters.
- Check is the field is allowing both Upper case and lower case alphabets.
- Check is the field is allowing to paste alphanumeric value in the field.
Test Cases For Mandatory Field
The 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 with the proper values those fields are marked as mandatory fields.
- Check is the mandatory fields of the application is marked with the special character like red star icon (*).
- Try to save the mandatory field without entering any data on the fields.
- Check for the alert message when you are trying to submit the form without filling the mandatory field.
- Check is the proper alert message is displaying or not.
- Check the behavior of the field when the user tries to submit the form without filling the mandatory field.
- Check is the valid values are saved on the mandatory field after clicking on the save or submit button.
- Check is the alert message is displaying when the user edits a mandatory field and left that mandatory field blank.
- Check for the laert message when the user submit the form by filling some mandatory fields and still some mandatory fields in blank.
- Check is the user is save mandatory fields by putting spaces.
- Check is the alert message is displaying when the user try to paste not accepted 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 as liable for payment of GST and 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 in relation to 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 number in the field.
- Check is the error message is displaying when you enter an invalid GST number in the field.
- Check is the first two characters of the GST number is Numeric value.
- Check the next 10 characters is the PAN number of the taxpayer.
- Check the 13 character will be a number from 1-9 or an alphabet.
- Check is the 14th Character should be Z.
- Check the 15th Character should be a alphabet or a number.
- Check the Field by entering mess then 15 Character.
- Check the field is allowing more then 15 Characters.
- Check the First two characters allowing alphabets.
- Check the first two field by entering one alphabet and one numeric value.
- Check the GST number firld by filling invalid PAn number after the first two character.
- Check the 13 Character is allowing 0.Check the field is allowing more then 15 Characters.fp[ick the 13 character is allowing alphabets.
- Check the 14 character is allowing other then Z.
How to Identify the GST number: 09AABCU9603R1ZL
- 09 – First 2 number represent the sate code as per indian Census .
- AABCU9603R1 – Next 10 character represent the PAN number of tax payer.
- Z-It is a default value
- L-It represent check code it can be number or alphabet.
How to verify the GST number?
To verify any GST number follow the below step
- Go to official GST website ie . https://services.gst.gov.in/services/searchtp
- Enter the GST number in Text box
- Click on search button
Test Cases For Pan Card
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 to save money on taxes, let you know about tax-related dates and any information related to it, help you in getting bank loans, etc. A person’s PAN card is their identity document which is 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 of the important Test cases for the pan card field were given. Pan Number Format: ABCDE1234F
Valid Test Cases
- Check by enter valid pan number in the pan number field.
- Check is the first 5 characters are upper case character.
- Check the next four character should be numeric character from 0-9.
- Check the last character should be an alphabet.
- Check there should be no spaces between 10 characters.
- Check is there any error message is displaying on entering invalid pan card number.
- Check is the pan card field allowing less then 10 character.
- Check the pan card number field is allowing more then 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 is the Aadhar card field is allowing Alphabets.
- Check is the Aadhar card field is allowing special characters.
- Check error message is displaying on entering invalid aadhar number.
- Check is the error message is as per the requirement.
- Check is the field is allowing blank spaces.
- Check is the field allowing 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 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 character long valid number.
- Check that first character of passport should be an Uppercase alphabet.
- Check that 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 next four characters should be any number from 0-9.
- Check that last character should be any number from 1-9.
- Check that error message showing or not when user enter the invalid passport number .
- Verify the alert message as 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 is 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 passport as number .
- Check the Passport field by entering the alphabet only .
- Check the passport field by entering number only .
- Verify the passport field by entering the second Char as 0(zero)
- Verify the pass port field by entering the last char as 0(zero ).
- Check that when user paste invalid passport number.
Test Cases for Amount Field (Currency Field)
- Check is the amount field is clickable or not.
- Check weather user is allowed to enter value into that field.
- Check is the field is allowing only numbers.
- Check is the field is allowing decimal values.
- Check is the field is allowing alphabetic characters.
- Check is the field is allowing special characters.
- Check is the field is allowing blank spaces between the numbers.
- Check is 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 is the field is allowing only zero values.
- Check is the field is allowing copy paste into the field.
- Check is the field is displaying alert message when that field as a mandatory field.
- Check the entered value is displaying properly to the user.
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 on the comment section.