Testing form submissions is a crucial part of load testing. Many applications rely on forms for authentication, data collection, and business logic (e.g., logins, signups, contact forms). There are multiple ways to submit form data, including traditional web forms and JSON-based API submissions. Below are examples of both methods.Documentation Index
Fetch the complete documentation index at: https://docs.loadforge.com/llms.txt
Use this file to discover all available pages before exploring further.
Tip: Use LoadForge’s Browser Recorder to automatically capture and replay form submissions. This simplifies setting up real-world interactions.
Submitting Standard Web Forms
A standard HTML form submission involves sending form data via aPOST request. Below is an example of a contact form submission in LoadForge:
Example: Contact Form Submission
Handling Redirects
Many form submissions trigger redirects (e.g., login forms). If your test needs to follow a redirect, addallow_redirects=True:
Submitting JSON Data
Modern applications often use APIs to handle form data as JSON payloads. Below is an example of submitting JSON data in LoadForge:Example: JSON POST Request
Common API Issues
If your JSON form submissions fail, check for:- Incorrect Content-Type – Ensure
Content-Type: application/jsonis set. - Missing Headers – Some APIs require authentication tokens.
- CSRF Protection – Some web apps reject requests without a CSRF token.
Debugging Form Submissions
If your test isn’t working, try:- Manually submitting the form in your browser and checking network requests in Developer Tools > Network Tab.
- Using LoadForge’s Debugger to analyze failed requests.
- Enabling logging to capture detailed request responses: