The validation function runs a single VU through the user scenario using our Load Generators. If the single VU is able to complete the scenario without errors then the script is validated. If the VU encounters any errors those are logged at the bottom of the page. Every time you validate a script, the scenario is automatically saved.
Whenever you are satisfied with your script, instead of saving it directly, you should always make a habit of validating it first. To do this, simply press the Validate button next to the Save button in the User scenario configuration interface. This starts a quick test run of your script with a single simulated User, in order to make sure the scenario runs correctly. All sleeps are removed from validations in order to make it as quick as possible. If the script can complete without any errors you will see the message “Validation finished!”. If there were any errors during the test run you will be notified and given an indication of where and what might be wrong.
A syntax error in a Lua script is an example of what would cause an error. Note that you can also get warnings in your validation. Warnings do not prevent the script from completing, so the validation will still be successful, but they point out things you might want to be aware of and possibly change. An example of a warning in a validation is if a URL in the script returns HTTP response code 404 (Not Found).
Making a habit of always validating a script before saving it is a good way of avoiding unnecessary failed tests that takes much more time to initialize than a quick validation. Note though that just because it validates successfully is no guarantee it will complete a large scale test. For example, there are errors that will only appear once the server is not behaving as expected anymore that can cause i.e. nil values where strings are expected in a Lua script unless this is checked properly.