Preparing the Data to Import Test Cases


Objective:

Converting test cases written in google sheets to an uploadable format supported by QATouch with help of a script.

Why use a script?

The current test case has the below limitations and needs to be formatted in a way that is compatible with QATouch migration.


Please download APP Script Code


Existing Test Case Template (Limitations):

  • 1. Every step added is entered in the next new cell.
  • 2. We do not mention the Module name for the test case.
  • 3. Merged rows are present in between the test cases.
  • 4. Test name column allows duplicate values.

The existing Test Case Step Template

image

QATouch Supported Format (Expected):

  • 1. Module and test case name field is mandatory in the tool.
  • 2. All field values of a test case should be on a single cell.
  • 3. Merged rows are not accepted.
  • 4. Test name field won't allow duplicate values.

QA Touch Template


image


Script logic:

The script will identify the row type of each row using the following conditions.

Rowtype Conditions Action
Empty All columns are empty No Action
Header or Comment If ID(col-1) OR TestName (col-2) OR Test description(col-3) OR Test tags (col-4) has any value (not empty) Delete that row
Test Steps Test Name & Description is empty & (Either Steps/Result is not empty) Add row id to the array
Test Case Start Test Name & Description is NOT empty & (Either Steps/Result is not empty)
  • 1. Add row id to the array
  • 2. merge all the steps to TC start cell
  • 3. Delete rest of the copied/merged steps

image

Please download APP Script Code

Excel sheet - APP Script image

Here you can download the script Copy and Paste APP Script Code in the editor.

image

image


image

image

Need to provide permission

image

image
image

image
image


If you getting above error message, need to add a Service,

  • Click Services enable "Google Sheets API"
  • Click Save button


image
image

Success message


image