Thursday, 2 May 2024

Testdata for everyone

 Being Testers we do lot many validations in day today life.

Listing few field values which can be used for testing.

Validation Testing

Validation testing on a website involves verifying that the inputs provided by users through various forms, textboxes, or interactive elements are correctly validated according to the specified criteria. Here's a general approach for conducting validation testing on a website

Company name

When validating a company name textbox, you'll likely want to account for various types of names that companies might have. Here are different types of company names along with examples:

Standard Company Name: Example: Microsoft Corporation

Acronym or Initialism:Example: IBM (International Business Machines)

Abbreviation:Example: FedEx (Federal Express)

Compound Word:Example: Facebook (Face + Book)

Hyphenated Name:Example: Dunkin' Donuts

Apostrophe in Name:Example: McDonald's

Numeric Characters:Example: 7-Eleven

Foreign Language Name:Example: Volkswagen (German)

Phonetically Spelled Name:Example: Lyft (Pronounced as "Lift")

Portmanteau:Example: Verizon (Vertical + Horizon)

Company names with special chars in name : 

Häagen-Dazs (ice cream company)

M&M's (chocolate manufacturer)

Moët & Chandon (champagne producer)

Häfele (furniture fittings and architectural hardware company)

L'Oréal (cosmetics and beauty company)

Müller (dairy company, often uses ü)

Hästens (luxury bed manufacturer)

Häcker Küchen (kitchen furniture manufacturer)

Hänel (manufacturer of vertical storage systems)

Pöppelmann (plastics manufacturer)

Email Address:

Validating email addresses can be a complex task due to the variety of formats they can take. Here are some different types of email addresses to consider when validating an email ID textbox:

When validating an email ID textbox, you'll typically check for the presence of an "@" symbol, the presence of a top-level domain, and adherence to certain formatting rules. However, it's essential to keep in mind that overly restrictive validation can prevent valid email addresses from being accepted, so it's crucial to strike a balance between strictness and flexibility. Using regular expressions or dedicated email validation libraries can help implement robust email validation logic.

Standard Email Address: 

Example: john.doe@example.com

Email Address with Subdomain:

Example: john.doe@sub.example.com

Email Address with Special Characters:

Example: john_doe123@example.com

Email Address with Numeric Characters:

Example: john123@example.com

Email Address with Top-Level Domain:

Example: john.doe@example.co.uk

Quoted Email Address:

Example: "john.doe"@example.com

Email Address with International Characters:

Example: josé@example.com

Email Address with IP Address:

Example: john.doe@[192.168.1.1]

Email Address with + Alias:

Example: john.doe+alias@example.com

Email Address with Domain Name Containing Hyphen:

Example: john.doe@example-domain.com

invalid email - ex1. asdsdT@@Aas

very long email id( per email standards, up to 64 characters are allowed in part before @ symbol) -ramakrishnapramahamsashrishramakrishnapramahamsashrishramakrishnapramahamsashrishramakrishnapramahamsashrish@test.com 

Phone Number

Validating phone numbers can vary significantly depending on the specific requirements and formats used in different regions or systems. Here are some common types of phone numbers and considerations for validating them:

When validating a phone number textbox, consider the allowed formats, country-specific conventions, and any additional requirements specified by the application or system. Regular expressions can be useful for implementing validation logic for phone numbers.


Standard Phone Number:

Example: (123) 456-7890

Validate that the number consists of 10 digits and may include parentheses, spaces, hyphens, or periods for formatting.

International Phone Number:

Example: +1 (123) 456-7890

Validate that the number starts with a country code (e.g., "+1" for the United States), followed by the area code and local number.

Phone Number with Extension:

Example: (123) 456-7890 ext. 1234

Validate the main phone number and optionally validate the extension number if provided.

Numeric Characters Only:

Example: 1234567890

Validate that the number consists only of numeric characters, without any special characters or formatting.

Phone Number with Country Code:

Example: 011441234567890

Validate that the number includes an international dialing prefix (e.g., "011" for dialing from the United States), followed by the country code and the local number.

Phone Number with Area Code:

Example: (123) 456-7890

Validate that the number includes an area code, which may be enclosed in parentheses or separated by hyphens or spaces.

Phone Number with Parentheses:

Example: (123) 4567890

Validate that the number includes parentheses around the area code and follows the specified formatting rules.

Phone Number with Spaces:

Example: 123 456 7890

Validate that the number includes spaces between groups of digits, following the specified formatting rules.

Phone Number with Hyphens:

Example: 123-456-7890

Validate that the number includes hyphens between groups of digits, following the specified formatting rules.

Toll-Free Phone Number:

Example: 1-800-123-4567

Validate that the number follows the format for toll-free numbers and may include specific prefixes (e.g., "1-800" in the United States).

Name

Validating names in a textbox can be challenging due to the wide variety of possible formats and cultural conventions. Here are some common types of names and considerations for validating them:

Validate that the name may include characters from non-Latin scripts, such as Chinese, Japanese, or Arabic.

When validating a name textbox, it's essential to balance flexibility with accuracy. Avoid overly restrictive validation that may prevent users with valid names from entering their information. Regular expressions can be helpful for implementing validation logic for names while considering the specific requirements of your application or system. Additionally, providing clear error messages can help users understand why their input was rejected and how to correct it.

Standard Name: 

Example: John Smith

Validate that the name contains alphabetic characters only and may include spaces, hyphens, and apostrophes.

First Name and Last Name:

Example: Jane Doe

Validate that the name consists of at least two parts: a first name and a last name.

Name with Middle Initial or Middle Name:

Example: David R. Johnson

Validate that the name may include a middle initial or a full middle name, separated by a space or period.

Compound Name:

Example: Mary Anne Smith-Jones

Validate that the name may include compound surnames or hyphenated last names.

Name with Special Characters:

Example: José Rodríguez

Validate that the name may include accented characters, diacritics, or other special characters commonly found in names.

Name with Numeric Characters:

Example: John123 Smith456

Validate that the name contains alphabetic characters only and does not contain numeric characters.

Title and Name:

Example: Dr. Emily Brown

Validate that the name may include a title or honorific (e.g., Mr., Ms., Dr., etc.) followed by the name.

Name with Prefix or Suffix:

Example: Jr., Sr., III

Validate that the name may include suffixes or prefixes indicating generational order or other distinctions.

Single Name:

Example: Madonna

Validate that the name may consist of a single word or alias.

Foreign Language Name:

Example: 李小龙 (Bruce Lee)

ZIP Code

 When you’re working with test data for ZIP codes, it’s important to consider a few key aspects to ensure your data is realistic and useful. Here’s a quick overview of what you might include:

1. Formats

ZIP codes can have different formats depending on the country. For example:

  • United States: 5 digits (e.g., 90210) or ZIP+4 format (e.g., 90210-1234)
  • Canada: A pattern of letters and digits (e.g., K1A 0B1)
  • UK: Various formats (e.g., SW1A 1AA)

2. Examples of Test ZIP Codes

United States

  • Standard 5-digit:

    • 10001 (New York, NY)
    • 30301 (Atlanta, GA)
    • 94105 (San Francisco, CA)
  • ZIP+4:

    • 10001-1234 (New York, NY)
    • 30301-5678 (Atlanta, GA)

Canada

  • Valid Formats:
    • K1A 0B1 (Ottawa, ON)
    • M5A 1A1 (Toronto, ON)
    • V6B 3B9 (Vancouver, BC)

United Kingdom

  • Valid Formats:
    • SW1A 1AA (London)
    • W1A 1AA (London)
    • EH1 1BB (Edinburgh)

3. Invalid or Edge Cases

  • Incorrect Formats: (to test validation)

    • 1234 (too short)
    • ABCDE (non-numeric for US ZIP codes)
    • 1234567890 (too long)
  • Non-existent ZIP Codes: (to test error handling)

    • 99999 (unlikely to exist in real use)
    • 00000 (usually not assigned)
  • International Formats:

    • Using ZIP codes from other countries for global applications.

4. Usage Scenarios

  • Validation: Ensure the system correctly identifies valid vs. invalid ZIP codes.
  • Geocoding: Test how ZIP codes are mapped to geographic locations.
  • Formatting: Verify if ZIP codes are stored and displayed in the correct format.

Creating a diverse set of test data can help ensure your application or system handles ZIP codes robustly and accurately across various scenarios.


Date

When testing date fields, it’s essential to cover a range of scenarios to ensure your system handles dates correctly and robustly. Here’s a comprehensive guide on what to include:

1. Valid Dates

Standard Formats

  • YYYY-MM-DD:
    • 2024-08-13 (Current date)
    • 2000-01-01 (Beginning of the millennium)
    • 1900-12-31 (End of the 19th century)
  • MM/DD/YYYY:
    • 08/13/2024
    • 01/01/2000
    • 12/31/1900
  • DD/MM/YYYY:
    • 13/08/2024
    • 01/01/2000
    • 31/12/1900

Time Included

  • YYYY-MM-DD HH:MM:SS:
    • 2024-08-13 15:30:00
    • 2000-01-01 00:00:00

2. Invalid Dates

Incorrect Formats

  • MM-DD-YYYY:
    • 08-13-2024 (if not supported)
  • YYYY/MM/DD:
    • 2024/08/13 (if not supported)

Out-of-Range Dates

  • Future Dates:
    • 2100-01-01 (if not allowed by system rules)
  • Past Dates:
    • 1800-01-01 (historically out of range)
  • Invalid Day/Month Combinations:
    • 2024-02-30 (February 30th does not exist)
    • 2024-04-31 (April has only 30 days)
  • Invalid Formats:
    • 2024-13-01 (Invalid month)
    • 2024-02-29 (Not a leap year, if applicable)

3. Edge Cases

Leap Years

  • Valid Leap Year Dates:
    • 2024-02-29 (Valid leap year date)
  • Invalid Leap Year Dates:
    • 2023-02-29 (Not a leap year)

Timezone Considerations

  • UTC vs. Local Time:
    • 2024-08-13 15:30:00 UTC
    • 2024-08-13 10:30:00 EDT (for a local timezone)

4. Special Cases

Date Ranges

  • Start and End Dates:
    • 2024-01-01 (Start of the year)
    • 2024-12-31 (End of the year)

Current Date/Time

  • Dynamic Test Cases:
    • Use the current date and time to test for real-time applications.

Null or Missing Dates

  • Empty Fields:
    • Ensure your system handles null or empty date fields appropriately.

5. Format Variations

ISO 8601 Format

  • Extended:
    • 2024-08-13T15:30:00Z (UTC)
  • Basic:
    • 20240813 (YYYYMMDD)

Alternative Separators

  • Slashes and Dots:
    • 2024/08/13
    • 13.08.2024

6. Testing Tips

  • Boundary Testing: Ensure your system handles edge dates correctly, such as the transition from one year to another or from one month to the next.
  • User Input: Test various user input methods and formats to ensure your system can handle different ways users might enter dates.
  • Localization: If your application is multilingual, test date formats in different locales and languages.

By covering these scenarios, you can thoroughly test date fields to ensure your application handles dates accurately and gracefully.

Text Area:

When testing a text area field in a web application or form, it's important to consider various types of input to ensure that the field handles different scenarios correctly. Here’s a guide to help you create comprehensive test data for a text area field:

1. Basic Valid Inputs

Short Text

  • Single Sentence:
    • "This is a short text."
  • Simple Paragraph:
    • "This is a simple paragraph. It has a few sentences."

Long Text

  • Multiple Paragraphs:
    • "Paragraph 1: This is the first paragraph. It contains several sentences to illustrate a longer piece of text."
    • "Paragraph 2: Here is the second paragraph. It continues from where the first one left off and adds more content."

2. Special Characters and Formatting

Special Characters

  • Common Symbols:
    • "!@#$%^&*()_+-={}[]|;:'",.<>/?`~"
  • Whitespace Characters:
    • "Spaces Tabs Newlines"

HTML Tags

  • Simple HTML:
    • "<b>Bold text</b> <i>Italic text</i> <u>Underlined text</u>"
  • Complex HTML:
    • "<div><h1>Header</h1><p>This is a paragraph inside a div.</p></div>"

3. Edge Cases

Maximum Length

  • Max Length Exceeded:
    • Create a string that exceeds the maximum character limit (if any) to test the field’s capacity and handling of truncation or errors.
  • Exact Length:
    • Fill the text area to the exact maximum length to check if it handles it properly.

Empty Input

  • Empty Field:
    • ""

Single Character

  • One Character:
    • "A"

Very Large Text

  • Large Block of Text:
    • Generate a long text block, such as several pages of text, to test how the field performs with extensive input.

4. Invalid Inputs

Script Injection

  • Potential Security Risks:
    • "<script>alert('XSS');</script>"

SQL Injection

  • SQL Commands:
    • "SELECT * FROM users WHERE username='admin'; DROP TABLE users;"

Unsupported Characters

  • Non-printable Characters:
    • "\u0000" (null character)

5. Localization and Encoding

Different Languages

  • Multilingual Text:
    • "こんにちは" (Japanese)
    • "Bonjour" (French)
    • "مرحبا" (Arabic)

Unicode Characters

  • Special Unicode Symbols:
    • "😊🌍🚀"

6. User Interface Considerations

Line Breaks

  • Multiple Lines:
    • "Line 1\nLine 2\nLine 3" (Ensure proper handling of line breaks)

Text Wrapping

  • Check Wrapping:
    • Verify that long lines of text wrap correctly within the text area.

7. Copy and Paste

Pasted Content

  • Rich Text:
    • Copy and paste text from a word processor or web page to check how rich text is handled.

8. Performance

Scrolling and Rendering

  • Scroll Test:
    • Ensure the text area properly handles scrolling when displaying long text.

By testing these scenarios, you can ensure that your text area field is robust and user-friendly, capable of handling various types of input and edge cases gracefully

Checkbox:

Field validation for checkboxes is crucial for ensuring that user selections are correctly captured and processed. Here’s a comprehensive guide to help you test and validate checkbox fields effectively:

1. Basic Validation

Checkbox Checked

  • Single Checkbox:
    • Test Case: Verify that the checkbox is properly marked when selected.
    • Expected Result: The checkbox should show as checked.

Checkbox Unchecked

  • Single Checkbox:
    • Test Case: Verify that the checkbox is properly unchecked when deselected.
    • Expected Result: The checkbox should show as unchecked.

2. Required Field Validation

Required Checkbox

  • Test Case: For forms where at least one checkbox must be selected (e.g., terms and conditions), ensure that the form cannot be submitted unless the checkbox is checked.
  • Expected Result: The form should display an error or prevent submission if the required checkbox is not selected.

Optional Checkbox

  • Test Case: For checkboxes that are not required, ensure that the form can be submitted with or without checking the checkbox.
  • Expected Result: The form should submit successfully regardless of the checkbox state.

3. Multiple Checkboxes

Select Multiple Checkboxes

  • Test Case: Verify that multiple checkboxes can be selected simultaneously.
  • Expected Result: Each selected checkbox should be checked, and the state of other checkboxes should remain unaffected.

Deselect Multiple Checkboxes

  • Test Case: Verify that multiple checkboxes can be deselected individually.
  • Expected Result: Each deselected checkbox should become unchecked.

Mixed State

  • Test Case: Ensure proper handling when some checkboxes are checked and some are unchecked.
  • Expected Result: The form should reflect the correct state of each checkbox.

4. Toggle and Dependency

Toggle All Checkboxes

  • Test Case: If there is a master checkbox that toggles all other checkboxes, verify that it correctly checks or unchecks all subordinate checkboxes.
  • Expected Result: Selecting or deselecting the master checkbox should apply the same state to all related checkboxes.

Conditional Checkboxes

  • Test Case: Test if certain checkboxes appear or become enabled/disabled based on the state of other checkboxes.
  • Expected Result: The visibility or interactivity of checkboxes should correctly reflect their conditional logic.

5. Default State

Default Checked

  • Test Case: Verify if certain checkboxes are checked by default when the form loads.
  • Expected Result: The checkbox should reflect its default state.

Default Unchecked

  • Test Case: Verify if certain checkboxes are unchecked by default when the form loads.
  • Expected Result: The checkbox should reflect its default state.

6. Accessibility and UI

Keyboard Navigation

  • Test Case: Ensure that checkboxes are accessible via keyboard navigation (e.g., using Tab to navigate and Space to select).
  • Expected Result: Users should be able to navigate and toggle checkboxes using the keyboard.

Screen Readers

  • Test Case: Verify that checkboxes are correctly announced by screen readers.
  • Expected Result: Screen readers should accurately convey the state and label of each checkbox.

7. Error Handling

Form Submission

  • Test Case: Ensure proper error messages are displayed if a required checkbox is not selected and the form is submitted.
  • Expected Result: An appropriate error message should prompt the user to select the checkbox.

Validation Messages

  • Test Case: Verify that validation messages are clear and correctly positioned near the checkbox or in a summary section.
  • Expected Result: Error messages should be easy to understand and help the user correct their input.

8. Edge Cases

Pre-checked State

  • Test Case: Test scenarios where checkboxes might be pre-checked based on user history or previous selections.
  • Expected Result: The pre-checked state should be correctly handled and displayed.

Invalid Input

  • Test Case: Simulate scenarios where invalid data might be submitted with checkboxes (e.g., tampering with form data).
  • Expected Result: The system should handle such cases gracefully and not process invalid inputs.

9. Performance

Load Performance

  • Test Case: Check the performance of forms with a large number of checkboxes to ensure they load and function efficiently.
  • Expected Result: The form should load and respond quickly even with a large number of checkboxes.

By covering these test scenarios, you can ensure that checkbox fields in your forms are functional, user-friendly, and robust.

Radio Button:

Field validation for radio buttons involves ensuring that users make valid selections and that the system correctly handles and processes those selections. Here's a comprehensive guide to testing and validating radio buttons in a form or application:

1. Basic Validation

Single Selection

  • Test Case: Verify that only one radio button can be selected within a group at any given time.
  • Expected Result: Selecting one radio button should automatically deselect any previously selected radio button in the same group.

2. Required Field Validation

Required Radio Button

  • Test Case: Ensure that a form with a required radio button group cannot be submitted until a radio button is selected.
  • Expected Result: The form should display an error or prevent submission if no radio button is selected in the required group.

Optional Radio Button

  • Test Case: For radio buttons that are optional, ensure that the form can be submitted with or without making a selection.
  • Expected Result: The form should submit successfully regardless of whether a radio button is selected.

3. Default Selection

Default Selected Radio Button

  • Test Case: Verify that one radio button in a group is selected by default when the form loads, if applicable.
  • Expected Result: The default-selected radio button should be visibly checked when the form is first displayed.

No Default Selection

  • Test Case: Ensure that no radio button is selected by default if the form is designed to start with no selection.
  • Expected Result: The radio button group should not have any pre-selected options if not intended.

4. Validation Messages

Error Handling

  • Test Case: Ensure that appropriate error messages are displayed if the form is submitted without selecting a required radio button.
  • Expected Result: An error message should prompt the user to make a selection before the form can be submitted.

Clear Feedback

  • Test Case: Verify that error messages are clear, specific, and positioned near the radio button group or in a summary section.
  • Expected Result: Error messages should help users understand what needs to be corrected.

5. Accessibility and UI

Keyboard Navigation

  • Test Case: Test that radio buttons can be navigated using keyboard (e.g., Tab key to navigate, Space key to select).
  • Expected Result: Users should be able to navigate through and select radio buttons using the keyboard.

Screen Readers

  • Test Case: Ensure that radio buttons are correctly announced by screen readers, including their labels and selected state.
  • Expected Result: Screen readers should provide accurate information about each radio button and its state.

6. Grouping and Mutual Exclusivity

Correct Grouping

  • Test Case: Verify that radio buttons are correctly grouped together and that each group functions independently.
  • Expected Result: Radio buttons within the same group should allow only one selection at a time, and selections in one group should not affect other groups.

Mutual Exclusivity

  • Test Case: Ensure that selecting a radio button in one group does not impact the selections in other radio button groups.
  • Expected Result: Each radio button group should operate independently, with only one selection allowed per group.

7. Performance and Usability

Load Performance

  • Test Case: Check the performance of forms with a large number of radio buttons to ensure they load and function efficiently.
  • Expected Result: The form should load and respond quickly, even with a large number of radio buttons.

User Experience

  • Test Case: Test the user experience to ensure that the radio buttons are easy to select, visually distinct, and not too close together.
  • Expected Result: Radio buttons should be spaced appropriately, easily clickable, and clearly labeled.

8. Edge Cases

No Selection

  • Test Case: Simulate scenarios where no radio button is selected when the form is submitted, if the selection is not required.
  • Expected Result: The form should handle this scenario gracefully without errors if the selection is optional.

Invalid Inputs

  • Test Case: Simulate scenarios where form data might be tampered with or incorrectly formatted to test the system’s handling of invalid inputs.
  • Expected Result: The system should handle such cases gracefully and not process invalid inputs.

Dynamic Radio Buttons

  • Test Case: Verify how the form handles dynamic changes to radio button groups (e.g., adding or removing options after the form has loaded).
  • Expected Result: The form should update correctly to reflect any changes in the radio button options.

By covering these test scenarios, you can ensure that your radio button fields are functional, user-friendly, and robust, providing a smooth and intuitive experience for users.

No comments:

Post a Comment

Jmeter - Get/print/display the Thread index nad loop index / ip address of current machine while executing script

Hi, If we need to print  Current thread count/index while execution in result -  thread No: (${__threadNum})  and if current loop count/ind...