On this page
A link checker can report that a page is reachable while the form or action button on that page is broken. A URL check and a form submission exercise different behavior: one may only request a page, while the other sends input and can change data.
This guide explains the difference and provides a local, non-production form you can use to practice testing safely. Browser documentation could not be consulted for this article, and the example was not executed here; check your browser’s documentation for details specific to your environment.
Key Takeaways
- A successful URL check does not prove that a POST action works.
- A button may require field values, an authenticated session, and server-side validation that a simple link check does not exercise.
- Test state-changing actions only in an authorized test environment with test data.
- Check the confirmation and, where appropriate, the resulting test record—not just the HTTP response.
Why a link checker cannot test a POST request by itself
An ordinary link checker typically discovers URLs and requests them with GET or HEAD to see whether they respond. A successful response can tell you that a destination is reachable; it cannot establish that a separate action succeeds.
A form submission may instead send a POST request containing field values to another URL. The server may need a signed-in session, check the submitted values, reject the request, or create a record before showing a confirmation. Some buttons also use JavaScript to send requests rather than submitting an HTML form.
For example, a checker might successfully request a contact page while the page’s Submit button fails because a required field is missing or the submission endpoint returns an error. The page URL and the action are related, but they are not the same test.
Some specialized checking tools can submit forms or run scripted workflows. Ask what a tool actually sends and verifies rather than assuming all link checkers have the same limits.
Advertisement
Try a safe local form submission
The following example runs a small form on your own computer using Python’s standard library. It does not connect to a production system, send email, or save a transaction. It demonstrates the distinction between opening a page and submitting a POST request; it is not a production web server.
Set up the form
Install Python if needed, save this code as form_lab.py, and run python form_lab.py from the directory containing the file. On systems where that command does not start Python 3, use the appropriate Python 3 command for your installation.
from http.server import BaseHTTPRequestHandler, HTTPServer
from urllib.parse import parse_qs
FORM = b"""<!doctype html>
<html lang="en">
<head><meta charset="utf-8"><title>Local form lab</title></head>
<body>
<h1>Local form lab</h1>
<form action="/submit" method="post">
<label for="name">Test name:</label>
<input id="name" name="name" required maxlength="80">
<button type="submit">Submit test</button>
</form>
</body>
</html>"""
class Handler(BaseHTTPRequestHandler):
def respond(self, status, body):
self.send_response(status)
self.send_header("Content-Type", "text/html; charset=utf-8")
self.send_header("Content-Length", str(len(body)))
self.end_headers()
self.wfile.write(body)
def do_GET(self):
if self.path == "/":
self.respond(200, FORM)
elif self.path == "/confirmation":
self.respond(200, b"<h1>Test submission accepted</h1>")
else:
self.respond(404, b"<h1>Not found</h1>")
def do_POST(self):
if self.path != "/submit":
self.respond(404, b"<h1>Not found</h1>")
return
try:
length = int(self.headers.get("Content-Length", "0"))
except ValueError:
self.respond(400, b"<h1>Invalid request length</h1>")
return
if length < 0 or length > 1024:
self.respond(400, b"<h1>Invalid request length</h1>")
return
try:
body = self.rfile.read(length).decode("utf-8")
fields = parse_qs(body, encoding="utf-8", errors="strict")
except UnicodeDecodeError:
self.respond(400, b"<h1>Invalid request encoding</h1>")
return
names = fields.get("name", [])
if len(names) != 1 or not names[0].strip() or len(names[0]) > 80:
self.respond(400, b"<h1>Enter one test name of 80 characters or fewer</h1>")
return
self.send_response(303)
self.send_header("Location", "/confirmation")
self.send_header("Content-Length", "0")
self.end_headers()
if __name__ == "__main__":
server = HTTPServer(("127.0.0.1", 8000), Handler)
try:
print("Open http://127.0.0.1:8000/ in your browser.")
server.serve_forever()
except KeyboardInterrupt:
pass
finally:
server.server_close()
Open http://127.0.0.1:8000/ in a browser. Stop the server with Ctrl+C when finished. If the address is already in use, stop the other local service or choose a different port in both the code and browser address.
Compare the checks
- Open or reload the form page. This requests the page, but does not submit the form.
- Select Submit test with the name empty. The browser should prevent submission because the field is required.
- Enter a fictional test name and submit. The form sends a POST to
/submit; the server checks the value and redirects to/confirmation. - Open the browser’s developer tools and inspect the Network panel while submitting again. Look for the POST request, its response, and the subsequent request for the confirmation page. Depending on the browser, you may need to preserve the network log across navigation.
The server’s validation is separate from the browser’s required-field check. The lab’s confirmation means only that the server accepted the input; no record was created. A real test may also need to verify a saved record or another intended effect.
Advertisement
Test a real action safely
Before submitting a form outside the lab, confirm you have authorization, identify the test environment, and use approved test accounts and data. A production submission can charge a payment method, send a message, change an account, or create work for another team. Do not trigger such actions on a live system without authorization.
For an authorized non-production test, check:
- Required fields: Try an empty required field and check that the user receives a useful message. Then provide valid test values.
- Validation errors: Use an invalid value allowed by the test plan. Check that the error is understandable and that no unintended test record is created. Browser-side checks do not replace server-side validation.
- Authentication and permissions: Test with an authorized test account. Where the test plan permits, check how an expired session or insufficient permission is handled. Avoid sharing credentials in screenshots or reports.
- Submission and confirmation: Submit valid test data once. Check the visible confirmation and inspect the network request if you need to diagnose a failure. A successful HTTP status alone may still contain an application error; a redirect alone does not prove the intended action completed.
- Result: If the action is meant to create or change something, verify the expected test record or other effect in the authorized test system. Check that it was not duplicated, and follow the team’s cleanup procedure.
Record the environment, account role, steps, visible message, and relevant request status in the defect report. Redact personal data, session information, and credentials.
Common Mistakes
- Treating a green URL check as an end-to-end test. It may never exercise the button or its POST endpoint.
- Checking only the confirmation URL. In the lab, that page can be opened directly; its existence alone is not proof of a submission.
- Assuming every button is a link. A button may submit a form or run JavaScript, and its behavior may depend on the page state.
- Testing repeatedly without checking side effects. Repeated submissions can create duplicate records or trigger repeated notifications.
- Ignoring session state. A test that works while signed in may fail after a session expires or for a different role.
Best Practices
Pair automated URL checks with authorized workflow tests for important actions. Define the expected input, permission, confirmation, and resulting state before testing. Use a test environment with safe integrations, and agree on how to inspect and clean up test records.
If a submission fails, capture the user-visible behavior first, then use the browser’s Network panel and available application logs to narrow down whether the problem occurred before submission, in the request, or while processing it. Share diagnostic details securely.
Conclusion
Link checks are useful for finding unreachable pages, but they do not by themselves prove that a POST-driven action works. Test the complete authorized workflow—from required input through confirmation and the intended result—in a non-production environment.
What would your domain sell for?
A free TidyURLs account unlocks the Domain Estimator. It prices a name from 191,011 real domain sales.