With StatusCake you can use a variety of methods to test basic “transactions”, including forms that deal with login, data protection and others.
Form and Raw POST data – We can send form or raw POST data along with our normal test requests, in many cases when dealing with HTML forms we can submit this data to the form in order to test the associated function.
Basic Authentication login – For pages where there’s not a HTML form to submit to, and instead access is gained through basic authentication. You can see an example of a Basic Auth dialogue below:
Content/String Match – Once we’ve submitted to the form or gained access to the page, it’s important to then verify that the expected page and results are returned. To do this we can use our Content Match feature. This will run a string match for one or multiple strings on the resulting page.
Final URL – You can use the Final URL feature to confirm that the page you’ve reached at the end of the process contains the correct URL, great for catching erroneous errors.
First of all you should assess which tools you need to use, and where the testing should be targeted. If you are dealing with a HTML based login form you should submit Form POST data, and your target should be the URL of that form rather than the main page URL.
If it’s a basic authentication job then your URL target should be that of the main page, and you should use the basic auth fields on the test on our end to gain access:
For other types of HTML form, which could be for a wide range of uses, you just need to grab the field submission names from the source code, these can again be entered in the Form POST field in valid JSON format with your desired values. This way you can use the feature to test pretty much any type of entry form.
Validating the Results
Once your form or login dialogue is being actioned, it’s time to set up validation of the process, this can be done in two ways.
String Match – Using the String Match field on the test you can confirm the presence of one or more strings in the source of the resulting page after whichever process has been carried out. You can be alerted optionally if these strings are found/not found.
Final Location – With this you can verify that the final URL in the process is an expected URL, for example if you are expecting http://mysite.com/allgood.php , but the URL reached is http://mysite.com/notgreat.php – you will receive an alert for the test.
Thanks for reading and just let us know if you’ve got any questions on this via our support channel!