Forum Discussion

dan78h's avatar
dan78h
Copper Contributor
Sep 24, 2019

Test Case Template

Hello,

 

I have a test template I am building that would require steps in the test case cycle to be updated depending on what platform the user would be testing when selecting this via a Drop Down Content Control.


For example, if a test analyst selected iOS, the form would auto populate fields individually (one row for one task) with a Drop Down Control Box for a pass or fail.


This could mean there is a list of 20 items within the single test case that may need to be populated based on the platform the test analyst chose.


I have attached a template I have been working on which I hope makes some sense.

 

Any ideas would be appreciated.

  • dan78h The first step is to save the document you posted as a macro-enabled template (*.dotm) file.

     

    The second step is to store each step's test action and its result in the template as an AutoText entry, using a naming convention that includes the step number as one part of the name and the platform (or some abbreviation of it) as another part of the name. (See the "AutoText in Word 2007" section of https://wordmvp.com/FAQs/Customization/AutoText.htm if you need instructions.) Also store one copy of the "Pass/Fail" content control as an AutoText entry. I've made a start on this step in the template that you can download from https://jay-freedman.info/Test_Case_Template.dotm, with steps for the iOS and Android Device platforms only. I leave it to you to add AutoText entries for the rest of the platforms.

     

    The last and largest step is to create a macro in the ThisDocument module of the template, naming the subroutine as Document_ContentControlOnExit(ByVal CC As ContentControl, Cancel As Boolean). That macro runs automatically any time the cursor moves out of any content control in a document that's based on this template. The code of the macro uses a Select Case statement to look at the value of the dropdown that was just exited, and uses that value to decide what to insert in the document. It updates the list of the Activation Type dropdown and creates the rows in the last table for the stored steps. Again, it's your job to insert similar code for the other platforms.