Update TestSheets

If the metadata information in your data sources has changed, you do not have to recreate your tests from scratch. You can update your TestSheets in the following ways:

Update via the Update Wizard

The Update Wizard is available for TestSheets created with the Vital Checks: Database To Database Wizard or the Pre-Screening: File Wizard.

The Update Wizard allows you to perform the following steps:

  • Update your TestSheets.

  • Update all linked TestCase templates and ExecutionLists. If you update Vital Checks: Database To Database TestSheets, the Wizard also updates your RequirementSets.

  • Auto-instantiate your TestCase instances.

To update your tests, follow the steps below:

  1. To open the Update Wizard, select a TestSheet and click on Update TestSheet in the dynamic menu TestCaseDesign.

    Alternatively, right-click on your TestSheet and select Tosca BI-><Wizard you want to use> from the context menu.

  1. Update your TestSheet with the Update Wizard:

Redefine the source

  1. The Update Wizard updates the status of each TestSheet instance with one of the following status updates:

Status

Description

OK

No changes occurred for this instance.

Changed

This instance has changed during the update process.

Added

This instance contains a new table match.

Deleted

The table match of this instance is not available in the data source.

  1. Review all changes for instances with the status Changed, Added, or Deleted.

  2. Remove all instances with the status Deleted in one of two ways:

    • Click on Clean-up Status in the dynamic menu TestCaseDesign.

    • Right-click on your TestSheet and select Tosca BI->Clean-up Status from the context menu.

Update via TC-Shell

You can use a TC-Shell command to update your TestSheets. For more information on TC-Shell commands, see chapter "TC-Shell commands".

To update your TestSheet via TC-Shell, follow the steps below:

  1. Navigate to the TestSheet and execute the command task "Vital Checks: Update Database to Database".

  2. Subsequently, the tasks asks you for a matching file. Continue with one of the following options:

    • Enter the path to the file you want to use for matching. For every backslash in the file path, the TC-Shell syntax requires an additional backslash as escape character.

    • Enter period (.) to use automatic matching instead of file matching.

The following example shows the TC-Shells commands for updating a TestSheet with a matching file:

tcshell -workspace "C:\Tosca_Projects\Tosca_Workspaces\TCShell\TCShell.tws"

cn "BI-Testing/TestCaseDesign/Vital Checks: Database to Database/Metadata"

task "Vital Checks: Update Database to Database"

Get 'FileWithMatches' > "C:\\Tosca_Projects\\ToscaBIDemoFiles\\files\\TableMatches.csv"

Update via TC API or TC REST API

You can update your TestSheets via the Tosca Commander API or TC REST API.

Update via TC API

Update your TestSheets via the TC API as shown in the example below.

using Tricentis.TCAPI;

using Tricentis.TCAPIObjects.Objects;

namespace SampleTCAPIUpdateDatabaseToDatabaseTestSheets {

internal class Program {

private static void Main(string[] args) {

TCAPI tcApi = TCAPI.CreateInstance();

TCWorkspace workspace = tcApi.OpenWorkspace("<Path to tws>", "<loginName>", "<loginPassword>");

TestSheet sheet = (TestSheet)workspace.GetTCObject("<Object ID>");

sheet.UpdateDatabaseToDatabaseTestSheetsWizard();

TCAPI.CloseInstance();

}

}

}

Update via TC REST API

You can use a TC REST API task to update your TestSheets. For more information on TC REST API tasks, see the REST API documentation.

To update your TestSheets, use the following command: GET http://toscaservicehost/toscacommander/exampleworkspacedir/object/<TestSheet ID>/task/UpdateDatabaseToDatabaseTestSheetsWizard