# Executing & Reviewing Test Scripts (Validation Management)

Paperless test execution is a fundamental part of the validation and qualification lifecycle for computerized systems, equipment, and other types of entities. Executors challenge user requirements and functional requirements using pre-approved test scripts. Using the Validation Management Test Execution Interface, Executors can easily perform procedures defined by test authors, understand expected results, reference requirements being challenged, describe their observed results and compare against expected results, and upload attachments to provide objective evidence. Discrepancies encountered during execution can be created directly from the test step where the issue was encountered. Discrepancies are also known as exceptions, nonconformances, deviations, or defects, depending on the organization.

Using the Test Review Interface, Independent Reviewers, Approvers, and Quality Unit Approvers can easily use a review-by-exception approach and ensure that all steps were completed in a compliant manner. Review-by-exception helps reviewers, approvers, and Quality Unit Approvers to focus their efforts on higher risk areas to streamline the review process.

## About the Test Execution Interface {#test-execution-interface}

When you perform the **Execute Test** action on a test which is in the _In Execution_ lifecycle state, Vault takes you to the Test Script Execution Interface.

### Test Script Header

This section includes the _Name_, _Title_, and _Run Number_ (if any) of the _Test Script_ being executed. This section also includes a link to view the associated protocol document in a mini-browser window when the _Test Script_ is not a stand-alone test script and is part of a _Test Protocol_.

### Navigation Panel

The navigation panel on the left side of the interface has several useful functions. At the top of this panel is a progress bar, which shows your percentage of assigned steps completed. This percentage is specific to each Executor, so if two or more Executors are working in the same _Test Script_, they may see different values.

The navigation panel, along with the comment panel, adjusts automatically based on screen resolution and browser window size to optimize users' interactions with the panel. You can collapse the panel by clicking (<i class="far fa-chevron-double-left"></i>) and expand it by clicking (<i class="far fa-chevron-double-right"></i>).

Clicking on a step or section in this panel navigates your view directly to it in the content panel. You can collapse and expand sections to efficiently navigate through large numbers of steps.

The step navigation panel displays an icon (<img class="inline" src="https://platform.veevavault.help/assets/images/val-harvey-22r22.png" alt="Incomplete Step" style="" />) when you have viewed a step or section, but have not yet completed it. The panel displays a checkmark once you have completed the step or section.

You can limit your view to only your assigned steps by selecting the **Show my steps only** checkbox in the navigation panel. Steps that are not assigned to you will show as gray in the navigation panel.

#### Comments View

If [configured by an Admin](/en/lr/50533906/#interfaces), the Comments View allows reviewers and approvers for _Test Scripts_ to provide feedback on specific steps or prompts as a part of their reviews. Reviewers can identify steps that require re-execution by adding comments with an execution category to automatically assign tasks to responsible Executors, and the Executors can address feedback and reply as necessary.

### Content Panel

The content panel in the lower right portion of the interface contains the _Setup Steps_ and _Execution Steps_ which you will execute. The content panel displays up to 25 steps per page.

### Action Bar

The top right of the interface includes a next step locator icon <i class="fal fa-crosshairs"></i> which takes you to the next incomplete step in the _Test Script_. The pause <i class="fal fa-pause"></i> or terminate <i class="fal fa-times-octagon"></i> icons may also be available depending on your Vault's configuration.

The _Review_ button allows Executors to access the Review interface for the test script. Executors can review the test step details and complete the test script or click the _Back_ button to return to the main view of the Test Execution Interface and complete the test script from the taskbar.

### Taskbar

The taskbar displays under the test header and lists the Executor's assigned task, the associated task instructions, and the task due date. The task due date color changes based on the number of days remaining until the task is due. A green due date means that five (5) or more days are remaining, an orange date means that less than five (5) days are remaining, and a red date means that the task is overdue.

The taskbar also displays a _Show More_ or _Show Less_ link and a _Complete_ button. Click the **Show More** link to expand the taskbar to display the full instructions for the task. Click the **Show Less** link to collapse and hide the instructions. The _Complete_ button allows the Executor to complete their assigned task. If configured by an Admin, Executors are prompted to provide a verdict and eSignature once they click **Complete**.

## Executing Test Steps {#execute-test-steps}

You can update and complete any step that is assigned to you, in any order. To execute a test step:

  1. Scroll to the step in the content panel or click the step in the navigation panel on the left.
  2. Perform the test as instructed in the step.
  3. If required, add an attachment.
  4. If you are performing an execution step, select a **Pass**, **Fail**, or **N/A** verdict as needed.
  5. If necessary, add comments, values, or discrepancies.
  6. If necessary, [pause][2] or [terminate][3] the test execution. This option may not be available depending on your Vault's configuration.
  7. Click **Complete** to finish the step. If you selected _N/A_ as the verdict in step 4, Vault prompts for confirmation in a pop-up dialog. Click **OK** to confirm the verdict selection and complete the step.

### Adding Attachments

Various actions during test execution allow you the option to add attachments. When an **Attachments** box appears, you can upload attachments by dragging and dropping files into the box, pressing **CTRL + V** or **CMD + V** to paste an image from the system clipboard, or by clicking **Upload files** and selecting one or more files. You can add up to five (5) attachments per execution step.  Execution steps may not require attachments if they've been assigned a verdict of _N/A_.

#### Attachment File Names

The resulting name of an attachment file differs depending on the source:

  * When you copy a source image from screenshot capture software like Snipping Tool or Snagit and pasted using the system shortcut, the resulting attachment file name is based on the system-managed name for the _Test Script_ record, combined with the system managed name for the _Test Step_ record, and followed by `_clip[#].[File Extension]`, for example, `TS-000012_STN-000234_clip3.png`.
  * Vault preserves the original file name when you copy a file from a file location such as the desktop, Finder, or Windows Explorer, then paste using the system shortcut.

#### Attachment Known Issues

  * When using the **Upload files** option to add attachments, use the system dialog to either drag and drop files or select and open them. Attempting both actions with the same system dialog may result in missed files.
  * You must click into the step or edit dialog before pasting from the system clipboard. Pasting may not work as expected with the Mozilla Firefox browser if multiple files are copied to the clipboard.
  * Copying and pasting files from a Windows desktop environment into the _Attachments_ box using **CTRL + V** may not function as expected in the Mozilla Firefox browser.

### Adding Comments

Click **+ Comment** to add a comment in a pop-up dialog, then click **Save**. Once saved, a comment icon <i class="fal fa-comment-alt"></i> appears in the _Test Step_. You can click the comment icon to edit your comment. You can make edits as long as you have not yet completed the step.

### Adding Discrepancies

If a discrepancy is required for a step, click **+ Discrepancy** to create a _Discrepancy_ record. In the pop-up dialog, add the **Title**, **Description**, and **Date**, upload attachments if necessary, then click **Save**. Once saved, a discrepancy warning icon <i class="fal fa-exclamation-triangle"></i> appears on the test step card. You can click the discrepancy warning icon to view the _Discrepancy_ records associated with the step in a dialog. From the dialog, you can navigate to record data and view attachments.

<div class="note-border alert-info">
  <div class="alert alert-info" role="alert">
    <div><i class="far fa-info-circle"></i></div>
    <div class="alert-text">
      <p><strong>Note</strong>: If the system fails to create a <em>Discrepancy</em> for any reason, the <em>Discrepancies</em>’ system-managed names may skip numbers in their naming sequence.</p>
    </div>
  </div>
</div>



### Pausing Test Execution {#pause}

The option to pause test execution may be available depending on your Vault's configuration. To pause test execution, click the pause icon <i class="fal fa-pause"></i> in the action bar of the Test Script Execution Interface. This action is also available from the **Actions** menu on the record's details page. In the dialog, provide a required **Justification to Pause Test**, then click **Pause**. You may be prompted to provide a verdict and electronic signature.

The _Test Script_ record enters a paused state where it cannot be executed. Click **View Justification** to view the justification for why the test was paused. In this dialog, you have the option to **Resume** or **Terminate** test execution. Choosing either option prompts for a justification.

Click **View Execution Change History** in the **Actions** menu to view a record of when the test execution was paused, resumed, or terminated.

### Terminating Test Execution {#terminate}

The option to terminate test execution may be available depending on your Vault's configuration. To terminate test execution, click the terminate icon <i class="fal fa-times-octagon"></i> in the action bar of the Test Script Execution Interface. This action is also available from the **Actions** menu on the record's details page. In the dialog, provide a required **Justification to Terminate Test**, then click **Terminate**. You may be prompted to provide a verdict and electronic signature.

The _Test Script_ record enters a terminated state where its execution cannot be resumed. Click **View Justification** to view the justification for why the test was terminated.

Click **View Execution Change History** in the **Actions** menu to view a record of when the test execution was paused, resumed, or terminated.

### Reassigning a Test Step

The option to reassign a test step may be available when a _Test Script_ is _In Execution_ depending on your Vault's configuration. To assign a different Executor, select **Reassign Step** from the **Actions** menu of a test step.

In the dialog, assign a **New Value** for the Executor. Depending on your Vault's configuration, Vault may also prompt for a **Change Reason** and **Justification**. Click **Save** to confirm the reassignment. Vault sends a task to the new Executor.

## Executor Review

The **Review** button in the action bar becomes available once all _Test Steps_ are completed. This section is a summary of the _Test Script_, including any discrepancies, failed steps, and changes made. Click on the numbers at the top of the Test Execution Interface to filter and review discrepancies, failed steps, and revisions pertaining to your assigned steps. This allows you to review-by-exception, clicking through each filter to review and decide if any [changes][1] are necessary. Click **Back** to return to the Test Execution Interface.

After finishing your review, click **Complete** in the task bar and provide an eSignature.

## Sharing Test Scripts with External Users

There may be instances where you want to present an executed or approved _Test Script_ to external users, such as an auditor or sponsor company, and need to provide evidence from the execution. To simplify this process, you can perform the **Generate Test Step and Discrepancy Attachment Zip** user action. This action generates a ZIP file containing all attachments from each _Test Step_ and/or _Discrepancy_ associated with the _Test Script_ and attaches it to the _Test Script_, which you can download and share with external users as required.

## Making Changes in Completed Test Steps {#making-changes}

Once a step is complete, a timestamp is applied to the step, and it receives a green checkmark in the left navigation panel. Any additional changes are tracked as though you are re-executing the step, and Executors are required to provide an eSignature for every change to a completed step. Changes can be made to completed steps for _Actual Results_, _Comments_, _Attachments_, _Verdict_, and _Executor_ (initiated by the **Reassign** action). To make changes to the actual results for an execution step:

  1. Click the pencil icon next to the _Actual Results_ field.
  2. Add a **New Value**.
  3. Add a **Change Reason**. Select from the following options: **Calculation Error**, **Entry Error**, **Late Entry**, **Other**, or **Spelling Error**.
  4. Add a **Justification** for the change to the completed step.
  5. Click **Save**. Provide your eSignature if prompted.

After successfully providing the eSignature for the edits, Vault updates the completion date/time to reflect the time the change was made by the logged in Executor.

Steps with changed results are marked with a delta icon <i class="fal fa-triangle"></i>. Clicking this icon displays all _Test Step Changes_ for the step.

The **Reassign Step**, **Edit Comment**, **Edit Verdict**, and **Add Discrepancy** actions become available after a step is complete. These actions require additional information similar to changing the actual results for a step and require eSignatures for the change to take effect.

If a _Test Step Change_ is not completed successfully because users do not have the necessary permissions or the Executor cancels the _Test Step Change_ after initiation, Vault creates the _Test Step Change_ record and updates the lifecycle state to _Cancelled_. _Test Step Changes_ that are not executed successfully are not counted in the revision count displayed on completed _Test Steps_ in the Test Execution Interface.

If you change the verdict of a completed _Test Step_ from _N/A_ to _Pass_ or _Fail_, required fields or attachments may be missing. In this scenario, Vault automatically moves the _Test Step_ to the _In Progress_ lifecycle state, clears the completion date/time, and removes the green checkmark from the left navigation panel for that particular step. You must populate all required fields and add at least one attachment before you can access the **Complete** button. If no required fields or attachments are missing, Vault executes the _Test Step Change_ and successfully modifies the verdict.

<div class="note-border alert-info">
  <div class="alert alert-info" role="alert">
    <div><i class="far fa-info-circle"></i></div>
    <div class="alert-text">
      <p><strong>Note</strong>: When you update a <em>Test Step</em> with existing attachments via a <em>Test Step Change</em>, the <em>Test Step Change</em> record’s audit trail lists the <em>Add Attachment</em> action to indicate the addition of the existing attachment from the <em>Test Step</em> record to the <em>Test Step Change</em> record.</p>
    </div>
  </div>
</div>



## About the Test Script Review Interface

Once the Lead Executor has provided an overall _Test Script_ verdict, the _Test Script_ then moves into a series of review phases before final Quality Unit approval. Vault provides a special Test Review Interface to facilitate this process. This process is performed by Independent Reviewers, Approvers, and finally, Quality Unit Approvers depending on your business process.

When you perform the **Review Test** action on a _Test Script_ record in the _In Independent Review_, _In Approval_, or _In QA Approval_ state, Vault takes you to the Test Script Review Interface.

### Test Header

This section includes the _Name_, _Title_, and _Run Number_, if any, of the _Test Script_ being executed. This section also includes a link to view the associated protocol document in a mini-browser window if the test script is part of a test protocol and not a stand-alone test script.

### Navigation Panel

The navigation panel on the left side of the interface has several useful functions.

Clicking on a step or section in this panel navigates your view directly to it. You can collapse and expand sections to efficiently navigate through large numbers of steps. You can also collapse the panel by clicking (<i class="far fa-chevron-double-left"></i>) and expand it by clicking (<i class="far fa-chevron-double-right"></i>).

### Main Section

The main section in the lower right portion of the interface contains the filters and fully executed _Test Steps_. Click on the numbers at the top of the main section to filter and review discrepancies, failed steps, and revisions. This allows you to perform a review by exception, clicking through each filter to review and decide if any changes are necessary and whether you will approve or reject the test script. The main section displays up to 25 steps per page.

### Taskbar

The taskbar displays under the test header and lists the Executor's assigned task, the associated task instructions, and the task due date. The task due date color changes based on the number of days remaining until the task is due. A green due date means that five (5) or more days are remaining, an orange date means that less than five (5) days are remaining, and a red date means that the task is overdue.

The taskbar also displays a _Show More_ or _Show Less_ link and a _Complete_ button. Click the **Show More** link to expand the taskbar to display the full instructions for the task. Click the **Show Less** link to collapse and hide the instructions. The _Complete_ button allows the Executor to complete their assigned task. If configured by an Admin, Executors are prompted to provide a verdict and eSignature once they click **Complete**.

## Blank Field Value Behavior

In test execution, the following behaviors apply to field values which are blank for any reason:

| Field | Functions As | Applicable Step Types |
|---|---|---|
| Procedure Setting | Procedure Enabled | Setup Step, Execution Step |
| Procedure Fit to Width | FALSE | Setup Step, Execution Step |
| Actual Results Setting | Actual Results Disabled | Setup Step |
| Actual Results Setting | Actual Results Required | Execution Step |
| Actual Results Fit to Width | FALSE | Setup Step, Execution Step |
| Expected Results Setting | Expected Results Enabled | Execution Step |
| Expected Results Fit to Width | FALSE | Execution Step |
| Attachments Setting | Attachments Disabled | Setup Step, Execution Step |

## Related Permissions

To use the Test Execution Interface or the Test Review Interface, users require [these minimum object and field-level permissions](/en/lr/50533904/#minimum-permissions), and a security profile which grants the following object access:

  * _Validation Entity_: Read
  * _Validation Requirement Entity Version_: Read
  * _Validation Activity_: Read
  * _Validation Deliverable_ (_Testing Deliverable_ object type): Read
  * _Validation Requirement_: Read
  * _Requirements Traceability Matrix_: Read
  * _Test Protocol_: Read
  * _Test Script_: Read
  * _Test Script Execution Change_:
    * Test Execution Interface: Read, Create, Edit
    * Test Review Interface: Read
  * _Test Script Execution Change Signature_: Read
  * _Test Step_: Read, Edit
  * _Test Step Change_: Read, Create, Edit
  * _Test Step Additional Prompt_:
    * Test Execution Interface: _Read, Edit_
    * Test Review Interface: Read
  * _Unit of Measure_: Read
  * _Discrepancy_:
    * Test Execution Interface: Read, Create, Edit, Delete
    * Test Review Interface: Read
  * _Related Discrepancy_:
    * Test Execution Interface: Read, Create, Edit, Delete
    * Test Review Interface: Read

  [1]: #making-changes
  [2]: #pause
  [3]: #terminate
