Creating a Template for Automated Tests

Updated by Jessica Holman

Templates are segments of test cases that can be saved and reused in multiple test cases. Templates allow you to save time and ensure app test consistency by creating reusable test steps for multiple test cases.

To create a template, you can create a new template while recording a test or convert an existing test case into a template. Once you've created a template, you can insert that template into any existing test case.

Creating a Template from a Recorded Test

  1. Log in to your Sofy account. 
  2. Select Device Lab from the left navigation bar.
    Sofy home page with a call out over the Device Lab option in the left navigation bar.
  3. Locate the device you want to test, then select Acquire.
    Device Lab page with a call out over the Acquire button under a device.
    Note: If a device is not available, the Acquire button will be grayed out. 
  4. Click Launch to open the device in a new window.
    Device Lab page with a call out over the Launch button under an acquired device.
  5. Wait for the app to install, then click the Recording tab. 
  6. Select the Start Recording red button at far right. 
  7. Check the Auto-handle system dialogs box to allow Sofy to automatically handle any system dialogs that pop up.
    Callouts for steps 5 through 7 on starting a recording.
  8. Select how you want to start the test:
    1. Start Fresh: Refresh the device to its default state before testing.
    2. Continue From Here: Record the test from the current state of the app.
      Options for starting a test recording: Start Fresh or Continue From Here.
  9. Interact with the device on the left and perform the steps you want to test in your app. Each step will be recorded and listed on the right. 
  10. Once you’re done recording your steps, click Stop Recording & Save Steps at the bottom of your screen.
    Device Lab page during a recording with a callout over the Stop Recording and Save Steps button.
  11. Click Save as Template.
    Callout over the Save as Template button at the end of a recording.
  12. Name the template, set the priority, and add a description. 
  13. Click Add Tag(s) if you want to assign tags to the template. Type the tag name in the field, then hit Enter to add the tag. 
  14. Select Save as Template

You can find your templates under the Templates tab in the Automation menu. 

Converting a Test Case into a Template

If you want to create a template from existing test cases, you can choose to either convert an entire test case into a template or choose specific tests from a test case to create a template. 

  1. Log in to your Sofy account.
  2. Select Automation from the left navigation bar.
    Sofy home page with a callout over the Automation option in the left navigation bar.
  3. Under the Test Cases tab, search for and select the test case you want to convert to a template. This will open the test case's edit view.
  4. Select the Create new template from test text located in the bottom right-hand corner.
    Callout over the Create new template from test text.
  5. In the new view, choose which steps you want to include in your template:
    1. Select the step you want to mark as the starting point for the template. 
    2. Scroll through the steps and select the step you want to mark as the ending point for the template. A black border will appear around all steps included in the template.
    3. To change which steps you want to include in the template, click on the blue circle found at the starting or ending point. Drag the circle to the desired location and release to redefine which steps are included in the template. 
      Steps on how to change which steps to insert in your test case.
  6. Name the template and add any additional details to identify the template. 
  7. Click Save.

You can find your templates under the Templates tab in the Automation menu. 


How did we do?