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

Mandatory field in Add Test Result


#1

Hi,

quick one is it possible to change Elapsed field when entering test result to mandatory for all testers ?

At the moment its not mandatory and some testers wont fill it.

Thanks,
Viljam


#2

Hello Viljam,

Thanks for your posting. While not a built-in feature, this is supported with UI scripts (starting with TestRail 3.0 ). I will prepare a small example for this and get back to you then.

Regards,
Tobias


#3

Hello Viljam,

Sorry that it took a bit longer but here’s the UI script for making the Elapsed field mandatory:

[code]
name: Make Elapsed field required
description: Makes the Elapsed field required on Add Result dialog
author: Gurock Software
version: 1.0
includes:
excludes:

js:
(document).ready( function() { .subscribe(‘result_dialog.loaded’, ‘uiscript1’, function(o)
{
$(’#addResultElapsed’).prev().append(’ *’);
});

    $.subscribe('result_dialog.validate', 'uiscript1', function(o)
    {
        if ($.trim(o.values.elapsed) == '')
        {
            $('#addResultErrors').append('Field Elapsed is a required field.');
            $('#addResultErrors').show();
            o.event.stopPropagation();
            return;
        }
    });
}

);[/code]

You can add this UI script under Administration > Customizations > Add UI Script.

Regards,
Tobias


#4

Thanks Tobias :slight_smile:


#5

You are welcome, Viljam.


#6

Hi,

I tried to borrow this UI script for making the “Elapsed” field mandatory, but got an error message:
“Line 8 uses an invalid format (“name: value” expected).”

Do I need a newer version of the script?


#7

Hello,

The latest TestRail version has built-in option for this so you can change the field settings under Administration > Customizations. I would recommend using this over an UI script.


#8

Finally we got the latest version installed, now using it. Thanks! :slight_smile:


#9

That’s great to hear, Malte :smile: Just let us know in case any questions come up about the new version, we are happy to help!

Regards,
Tobias