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/json
is 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: