Skip to content
QA Knowledge Hub

Test cases for a contact form

Updated 2026-11-13 · 6 min read

These 30 cases use explicit test fixtures and checkable outcomes. Cover normal behavior, boundaries, recovery, security and usability, then adapt the requirements to your product.

How to answer in an interview

Ask which fields are mandatory, where submissions go, whether attachments exist, and what the success message promises. Cover validation and the handoff to the support queue separately. A green toast does not prove that a support request was stored.

Scope and test data

These 30 cases assume name, email, topic and message fields, with an optional phone number and no attachments. Use Asha Test, [email protected] and 9000000001 only as synthetic fixtures. Route every notification to a local mail sink; do not send real email.

For this example, trimmed names allow 1–80 characters and trimmed messages 1–2,000 characters, counted by the application's documented character rule. Topics are Sales and Support. One submission creates one queue record and a reference ID; success means accepted into that queue, not read by a person. Define the throttle threshold and latency target in the test plan before executing the relevant rows.

These are proposed manual test cases, not an execution report. Run security and load checks only in an authorised isolated environment. Record agreed limits before execution; a case without its required limit is not ready to pass or fail.

Validation and useful input

IDCategoryTest caseExpected result
C01FunctionalSubmit valid required fields with phone left emptyOne queue record contains the entered values and a reference ID is displayed
C02NegativeSubmit all fields emptyEach required field is identified; no queue record is created
C03NegativeOmit each required field separatelyOnly the missing field is reported; other entered values remain
C04NegativeEnter only spaces for name or messageRequired-field error appears after trimming
C05FunctionalUse a name containing an apostrophe, hyphen or Hindi charactersThe name is stored and displayed without corruption
C06NegativeEnter asha@ as the emailAn email-format error blocks submission
C07FunctionalUse [email protected] in the isolated mail sinkValid address is preserved; submission is accepted
C08FunctionalPaste a multiline message with punctuation and Hindi textLine breaks and text survive in the support record
C09BoundaryUse trimmed names of 1, 80 and 81 charactersFirst two pass; 81 is rejected with the name limit
C10BoundaryUse trimmed messages of 1, 2000 and 2001 charactersFirst two pass; 2001 is rejected without silent truncation

Submission and recovery

IDCategoryTest caseExpected result
C11FunctionalChoose each supported topicStored topic matches selection and routes to its configured test queue
C12NegativeChange the topic to an unknown value in the requestServer rejects it; no arbitrary queue is selected
C13FunctionalDouble-click Submit during a slow responseOne accepted submission and one reference ID result
C14NegativeDisconnect before submission reaches the serverNo success is shown; entered fields remain available for retry
C15NegativeLose the response after the server accepts the request, then retryRetry resolves to the same logical submission without a duplicate queue entry
C16NegativeSimulate queue persistence failureFailure is shown; the form does not claim successful acceptance
C17FunctionalRefresh after successful submissionNo automatic resubmission or second support record occurs
C18FunctionalInspect the sink notification after acceptanceReference, topic and message match the queue record; recipient is the configured test sink
C19FunctionalFail notification delivery after queue acceptanceAccepted record remains available; notification failure is observable for retry
C20NegativeExpire an authenticated session before submit, if login is requiredReauthentication is requested without accepting the request under another identity

Abuse, usability and operational checks

IDCategoryTest caseExpected result
C21SecurityBypass browser validation and submit an overlength messageServer enforces the same limit; no oversized record is stored
C22SecuritySubmit markup-like text and inspect the support viewerText cannot execute scripts in the form, confirmation or support interface
C23SecurityPut newline characters in a field used to construct mail headersInput cannot add recipients or extra headers to the sink message
C24SecurityExceed the configured submission throttle in an authorised testFurther submissions are limited with a retry explanation; accepted count matches policy
C25SecurityIf cookie-authenticated, submit from an untrusted originRequest is rejected by the application's cross-site request protection
C26UISubmit errors using keyboard and screen readerFields have labels; errors are associated with fields and focus reaches a useful correction point
C27UISubmit successfully with a screen reader activeAcceptance status and reference are announced without requiring visual inspection
C28CompatibilityComplete the form on supported mobile and desktop browsersAll required values and the reference survive each submission path
C29PerformanceSubmit the agreed peak workload to the test queueAcceptance latency meets the recorded budget; accepted requests are neither lost nor duplicated
C30SecurityInspect URLs and routine analytics after submissionMessage, email and phone do not appear in URLs or analytics events

Prioritise the queue boundary

Start with valid submission, missing fields, server-side validation and retry after an ambiguous timeout. Capture the reference ID and inspect the test queue through authorised tooling. A request that was accepted but whose notification failed is a different defect from a request never stored.

The common interview mistake is promising that an email “must arrive immediately.” Ask what acceptance and delivery mean, who owns retries, and which service-level target applies. Browser validation improves feedback but does not replace server validation.

Downloads

Quick answers

Does successful submission prove email delivery?

No. Check queue acceptance and sink delivery separately. The confirmation should describe only the stage that has completed.

Should a contact form require a phone number?

Only if the product needs one. Test the documented optional or required rule without assuming every contact must use an Indian mobile number.

Sources

Want a project you can show in interviews?

The portfolio project kit walks you through testing a deliberately buggy app with Selenium or Playwright and API tests, then explaining it. The app itself is free.