A few posts back, we discussed how to automate a login form test, but what about other types of forms you might find on your website? In today’s post, we’ll show you how to automate a search form test using Testomato.
Is testing the search function important?
We don’t have to tell you how important search is for the visitors or users of a website. Developers and designers alike know that search is a key functionality for accessibility and usability – so what happens if it’s not working properly?
The search function is so common that when we come across websites, especially large ones, without it (or a website where it’s not working)- well, it’s incredibly frustrating. The kind of frustration that makes us click around angrily, “harumph” indignantly a few times, and then flee that site and never return again.
The bottom line: No matter how simple or well-though out your navigation and website hierarchy is – there are some users that won’t understand it. So, it’s crucial that you test for problems. If your search isn’t working correctly, you’re going to lose traffic.
And, if you have a business or an e-commerce website, super size that warning.
A few more notes before we get started…
- To find your forms, Testomato downloads your website’s source code and identifies all the forms present in the HTML, including the search form you’d like to test.
- Currently, you are not able to manually define a search form test using Testomato. This just means that we have to find it automatically for you before you can start configuring your test.
- For the purpose of this tutorial, we’ve used screenshot examples for reddit’s search form.
Here’s how to test a search form:
1) Create a new project or select a project from your Dashboard!
2) In a project’s basic test suite, any forms that have been found will be displayed as gray boxes with the <title> of the page displayed. These boxes will remain gray until the tests are configured. See an example Search form below:
3) Select your unconfigured “Search” form and click on the edit button in the right hand corner.
4) Configure your form by entering the data you’d like to send to your form. In this example, we’ve entered “gosling”.
5) Configure your Expectations & Results:
Here, we expect to find the text string containing: “search results” and “Ryan Gosling”.
We’ve entered: “there doesn’t seem to be anything here” for our missing text string. Since we expect our search term to be accessible and searchable, this text should NOT be present on the page.
6) Press Save. Your Search form will now be tested each time your test suite is run!
Your test case should now look a little something like this:
And, the full results of your configured test will look like this:
We hope this post has taught you a little more about how to automate another important aspect of your testing process using Testomato.
Did you find this post helpful? Still have questions?
Thanks for reading! We appreciate it!