What We Are Learn On This Post
Test Case For Date Field Calendar: Welcome to another new post of the test case series. In this post, we’re going to learn how to write a test case for a date field of Calendar type, when you click on the dead filled a calendar Popup will open from here you can able to select a date.
Before I started writing how to write a test case for the date field, let me ask a few simple questions? Have you any prior knowledge on how to write test cases, if you have then you can proceed with the post, but if you don’t have any experience on how to write test cases then we can recommend you to go through with our previous post.
Post On: | Test Case For Date Field Calendar |
Post Type: | Test Case Template |
Published On: | www.softwaretestingo.com |
Applicable For: | Freshers & Experience |
Join Here: | Telegram Group Link |
If you have no prior knowledge of how to write test cases and you have jumped into this post, you may get so much confusion. That’s why we are suggesting you start from the fundamental topics like your test case and why we required a test case in our organization. After that, you can go with some of the previously shared cases.
Now let’s start with how we can write any meaningful and straightforward test cases for the date field. If you want to know how the date field behaves, we have added an example of a date-filled calendar. You can go through with that calendar field and try to understand the functionality of that.
Date Field Example
You can use the below code to see an example. For this, you need to copy the whole code and save the calendar.html file.
<html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>jQuery UI Datepicker - Default functionality</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <link rel="stylesheet" href="/resources/demos/style.css"> <script src="https://code.jquery.com/jquery-1.12.4.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <script> $( function() { $( "#datepicker" ).datepicker(); } ); </script> </head> <body> <p>Date: <input type="text" id="datepicker"></p> </body> </html>
Date Field Calendar Test Cases
- Click on the date field and check whether a date calendar widget should open.
- Check the width and height of the date calendar widget is yes per the specification document.
- Check if a user-selected date from the date calendar bigger than the selected date should be displayed in the date field.
- Check after a click on the date field the calendar should be displayed current month, and current dates should be highlighted.
- Check the header of the calendar widget should display the current month and a year.
- Check by using the previous, and then the next button, the user can switch from one month to another month.
- Check the user should be able to enter a date in that date field.
- Check a user can edit and select a date or not.
- Check what are the characters or special characters are allowed in the date field (the dead area should allow all the numeric characters And two other special characters which are hyphen ‘-’ and slash ‘/’ )
- Check the date field should not allow invalid dates.
- Check the date field as such dates in a specific format like dd/mm/yy or mm/dd/yy or yyyy.
- Check the date field should not accept the value for the day, less than one and greater than 31.
Negative Test Cases For Date Field Calendar
- Check that date field is allowing unique character or not if it is allowing the special character except this loss and hyphen then that death should not be discarded.
- Check the date field is accepting foreign language characters or not will stop
- Check the calendar widget on different screen sizes like small or large screens.
Test Cases if the Date field is not a text box:
- Ensure that the calendar window is displayed and active when the calendar is invoked by pressing the calendar icon. (Once we faced an issue, the calendar window is in a minimized state when we invoked the schedule.)
- Ensure that calendar date has defaulted to system date
- Ensure that when a date is selected in the calendar (double click or some other method) the chosen date is
- Displayed in the text box and calendar should be disappeared from there.
- Check for the format as per requirement I .e.mm-dd-yy
- Check for the list of years by click on down arrow displayed years of the selected year before and after ten years
- Check for the list of 12 months by click on month down arrow
- Check for the clear of date by click on the clear text link in the calendar what before selected
- Check for the month changed to the previous month by click on Prev text link
- Check for the month changed to after months by click on next text link
- Check for the today date highlighted or not by click on the today text link
Test Cases if the Date field is an editable text box
- Enter the valid date, month, year.
- Enter the invalid blank space and valid month invalid blank space.
- Enter the invalid blank space and invalid blank space and invalid blank space.
- Enter the zeros in date and invalid blank space and zeros in the year.
- Enter alphabetic, alphanumeric data in the field.
- Enter special characters.
- Enter a decimal point.
- Enter valid date, invalid blank space in a month, invalid blank space in a year
- Enter an invalid date like a valid month and invalid blank space in a year.
- Enter an invalid date, invalid blank space in the month, and valid year.
- Enter the invalid date and valid month and valid year
- Enter the valid date and valid month and invalid year
- Enter the valid date and invalid month and valid year
- Enter the valid date and invalid month and invalid year
- Enter the invalid date and invalid month and invalid year
- Enter the invalid date and valid month and invalid year
- Leave blank spaces for all the fields.
- Check whether the year entered is a leap or an ordinary year.
- For an ordinary year, the max limit of number in day field in the month Feb should be 31.
- For leap year the max limit of number in day field in the month Feb should be 29.
- With respect to the corresponding alternate months, corresponding numbers in the day field i.e 30/31 should be accepted.
- Enter the date below/beyond the range, i.e 32 or 0, etc.
- Enter the month below/beyond the range,i.e 13 or 0…
- Enter zero before the single-digit number in date/month.
- Check without entering zero before the single digit.
- Enter a valid date, valid month, and only last two digits of the year.
- Enter any alphabets in these fields.
- Enter special characters and check.
- Enter zeroes in all the fields.
- Check whether the control passes on to the month field after entering the date.
- Also, check whether the control passes to year field after entering date and month.
- Check the format of the date, month, and year.
- Check whether it is accepting date in the date field, month in month field, and year in the corresponding field.
should not accept 000000 as a date.
Conclusion
I thought after going through this post, you get a little bit of knowledge on how to write test cases the date field. If you are still finding some more test cases on the date field, you can inform me that I was in the comment section by writing or adding a comment below.
If you want to try yourself on some test scenarios, then we can recommend it to you the billows best scenarios. If you are interested in sharing for the review, go to the contact us page and share your test scenarios or test cases.
If you want to share something with this testing community, you can write to us with all the details at softwaretestingo.com@gmail.com.
Hi , your article was very helpfull . Can you please link these case with save button functionality. Like this cases will perform with save or cancel button.