Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

Custom field validation


#1

Hello, we need for one test case template a custom fields for longitude and latitude. The long./lat. user entry has to be checked e.g. separator is a “.” not a “,”, digits only and length of the string after the separator before the test case is committed.

Question:

  1. Is this possible?
  2. If yes, do you have a documentation how to implement custom validation?

#2

Hi there,

Thanks for the post. Currently there is not a way to set your own validation rules with custom fields out of the box, so you wouldn’t be able to configure rules like the length of the string or a specific format. For your purposes, you can create an integer field, which will only accept numeric values, but you wouldn’t be able to specify the length or formatting of the entered values.

It may be possible to set up a custom UI Script that will validate the content of a specific field when creating or editing a test case and inform the user that it needs to be updated. We wouldn’t be able to provide a specific example of how to set that up, but if you’d like to give that a shot I’d recommend checking out the guide on how to set up UI Scripts here:

http://docs.gurock.com/testrail-custom/uiscripts-introduction