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

Test Result - Add Result: Compare Test Steps with Attached Screens


Testrail version v5.2.1.3472

I am trying to create a UI customization script to validate that the number of screenshots attached matches the amount of steps on a test case but

a) the result_dialog.validate is not being triggered.
b) Is there documentation to find the count of Testcase steps and the Testcase Results Attached Screenshots (or comments)?

Some help with the actual JS would be greatly appreciated.

Thanks in advance.


Hi Gabriel,

Thanks for the post! We currently do not have any examples of validating test step counts against the number of screenshots attached to a test result and our support team would generally not be able to help implement custom UI scripts, unfortunately.

That being said, you should be able to count the number of steps by counting the step-row elements inside the custom_step_results_table or retrieving the text of the last step-index-inner element.

In regards to screenshots, this implementation would vary depending on how the screenshots are uploaded into the results dialog, so you may need to implement a complex approach to counting these screenshots, as they can be embedded inside text for individual steps using markdown, uploaded to the attachment field, or both.