3 Different Ways to Test a Signup Form
We’ve seen with Testomato projects and know from personal experience how important forms are for online projects.
They’re how users sign up to join a service, join newsletters, submit enquiries, and how sales are made. Forms can also be one of the most common areas for problems on websites, particularly on those that have just launched.
So, it’s important to test and make sure they’re working properly!
A user recently asked us how to test signup forms in Testomato, so we pulled together a short guide to show you the testing options you have available.
A Quick Word about Form Testing
As you might already know, you can create tests on Testomato to test the forms on your website or application. We check whether your forms are returning the correct expected pages and ensure no common error messages are present in the HTML.
You can also:
- manually select the web page you want us to search for forms.
- select a form you want tested if there are multiple forms present on the page.
- send data to your form using POST commands once your forms are configured.
Currently, we download your website’s source code and automatically create tests for any forms (<form></form>
tags) we detect. These tests will appear as gray boxes in your project dashboard until you’ve configured them.
Important things to know about our form tests:
- Testomato doesn’t detect client-side generated forms.
- We can’t beat CSRF (Crosss-Site Request Forgery)
Common Problems that Affect Form Function
Since every website and application is unique in its design and features, there are a number of variables on your site that can affect whether a form is functioning correctly.
Here are some of the most common problems:
- Submit / Subscribe button doesn’t not behave as expected.
- Submit / Subscribe button doesn’t submit to servers after it’s clicked.
- Form submits to the wrong location.
- False success messages.
Signup Form Testing in Testomato
So, what’s the best way to test a form using Testomato?
Here are 3 different ways to approach signup form testing in Testomato:
All of the following options will start from your project dashboard.
To get started, you’ll need to click on the link to Configure this form test for your registration or signup form.
1) Create a new user each time you test.
Create a new user for every signup form test, which you can then periodically delete by running a separate script.
- Click Configure form values.
- Enter the data you would like sent to your form and click Save.
- Scroll down and click Save.
Important note: We support random form values. To learn more about using them to test your forms, check out this tutorial.
2) Use the same user for every form test.
You can create the same user for every form test with the return error: “username is already in use”.
- Click configure form values.
- Enter the data you would like sent to your form and click Save.
- Select the box next to check for string occurrence.
- Enter the expected message you’d like to see. For example, we have the error message:
Our string tests are configured with the following:
- Click Save.
3) Add a switch to your own code.
Add a switch to your code that corresponds with the user you’ve created on Testomato.
Important Note: The following option will require some changes to the code of your application.
- Click on the configure this form test.
- Change your URL and add a new parameter (e.g. testomato=1) and click Configure form values.
- Enter the data you’d like to be sent to your form and click Save.
- Create a user account with your application, which can be deleted after a set period of time.
Adding a switch to your code just for the user you’ve created on Testomato will only allow your code to be partially tested.
For example, if the switch prevents you from saving a user to your database then you won’t be able to test whether or not a user is saved to your database.
We suggest allowing a user to be created, but adding the switch at the end of the request process and delete the user from the database afterwards (but keep in mind there’s a risk that the user deletion may fail).
Should we add the option for random form values?
We’ve been considering adding support for random form values to Testomato’s form tests and would love to hear whether or not this would be useful for you.
Share your ideas with us support@testomato.com or leave us a comment below. You can also join us on Facebook or Twitter.