Table of Contents
Testing a Form Capture is important because you want to ensure that your end users have the best experience when using this form. If they encounter certain errors or other issues, they won't be able to submit the form and you'll lose valuable data.
Since you may have one or more staging environments/websites, we'll look at the three main testing scenarios you're likely to encounter, as well as a simple test on a production site/environment. Remember that references to the tracking script below are only needed if you plan to implement it. If you are not including it on your form's page, you can skip that information.
Production Site and Environment
This is the simplest test because it's a straightforward test of your form capture. Go to the webpage your form capture is on and submit it. If it's submitted successfully, you'll be taken to your success page and in your environment you will also be able to view the Posted Form record.
In the example above, you can see the successful submissions that came from a form capture. The Success field for the record is set to Yes if it came through correctly, but there is one with a No value, indicating that the submission didn't come in correctly.
Staging to Production Environment
When setting up your Form Capture record and fields in a staging environment, but setting up the form on your live website, you'll need to handle the following items as described below.
Form Capture Record
Have Form Capture records set up in both your Staging and Production environments.
Action URL
When testing from your Staging environment, use the Action URL from that environment's Form Capture record. Then, when you're going live with it, you'll switch the Action URL to be the one from your Production Form Capture record.
Form Fields
Set up the Form Capture Fields in both environments. You don't have to associate them with the exact same Form Fields that will be in your Production environment, but you'll want to use similar fields so that you have a good indicator of how your form capture will work.
Once you're ready to go live, the main thing you'll need to do is make sure that the Name attribute (in your form HTML) for each field matches the Form Field ID in Production. If you're concerned about absolute parity, you can export Form Fields from your Staging environment and import them into Production.
Domain Record
Have a Domain record for your website in both your Staging and Production environments. This will help with the Tracking Script.
Tracking Script (optional)
When testing in Staging, use that environment's tracking script on your webpage and just make sure that you have the website domain in the script. (This is why you need a domain record for your site in this environment.) Then when going live, just switch the tracking script to your Production environment's script.
If your site has a global footer that uses your Production tracking script, you can try testing with that script in place (instead of the Staging script), but if you run into issues with the form capture submitting, then you'll need to ask your web developer for a page without that production script in place.
Staging to Production Website
On the flip side, if you're setting up your Form Capture record in your production environment but are testing the form on a webpage on your staging website, you'll only need to focus on the following two items.
Domain Record
Have a Domain record for your staging site in your environment.
Tracking Script (optional)
Use your regular tracking script but while testing on your Staging site, make sure the domain matches that site. Then, when you move the form capture to your Production site, you'll just need to edit the script to reflect the Production domain.
Staging to Production Environments and Websites
If you're testing on a staging environment and website, you'll need to marry the two scenarios above in order to best test and migrate. Here's how to do that.
Form Capture Records
Have a Form Capture record set up in each environment, complete with the Form Capture Fields.
Action URL
When testing in Staging, use the Staging record's Action URL in your <form>. Once you copy your form over to Production, just switch the URL to the one from the Production record.
Form Fields
Associate your Staging Form Capture Fields with Form Fields that are the same or similar to the Form Fields in Production.
Once you're ready to go live, the main thing you'll need to do is make sure that the Name attribute (in your form HTML) for each field matches the Form Field ID in Production. If you're concerned about absolute parity, you can export Form Fields from your Staging environment and import them into Production.
Domain Record
Have Domain records for both sites, in their respective environment. The Staging environment should have the Staging website domain, and the Production environment would have the Production domain.
Tracking Script (optional)
On your Staging site, test by using the Staging Tracking Script with the Staging domain. Then in Production, you'll use the Production Tracking Script with the Production domain.