共用方式為


CATS Without the CTK (Compact 7)

3/12/2014

You can run the Windows Embedded Compact Test Kit (CTK) Automation Tool Solution (CATS) tool without needing to launch the tool from within the CTK. You may prefer to run the CATS tool without the CTK if you do not want the system overhead of starting the CTK or if you need to run the CATS tool from a command line. After you provide test parameters to the CATS Wizard and then run the CATS Wizard executable (CATSWizard.exe), the CATS tool creates configuration files that you use to complete a CATS automated test pass in stand-alone mode. You can manually define an automated test pass by adding the tests that you want to perform to the .pvt script file, which is one of the configuration files that the CATSWizard.exe creates. The following steps guide you through the process of running the CATS tool without the CTK and editing the .pvt test script file.

Run the CATS Tool in Stand-alone Mode

You can run the CATS tool in stand-alone mode, which does not require the CTK. The CATS tool uses a wizard, CATSWizard.exe, to create the needed configuration files that you use to run a CATS test pass in stand-alone mode.

To run CATSWizard.exe in stand-alone mode

  1. On your development computer, browse to the CTK installation folder and locate the CATSWizard.exe file.

    By default, CATSWizard.exe is located at C:\ProgramFiles\WindowsEmbeddedCompact7TestKit\tools\TestAutomation\CATSWizard.

  2. Double-click CATSWizard.exe.

  3. In the CATS Wizard, on the Inputs tab under Select source for tests to be added to Automation script (pvt file), select None (creates an empty script).

    This option creates an empty .pvt script file that you can then add your custom test choices to.

  4. Complete the rest of the wizard by providing details as specified in CTK Automation Tool Solution (CATS).

  5. Click Create.

Editing the .pvt Script File

After the CATS Wizard creates the configuration files for the test pass, the CATS tool uses this group of files in conjunction with a batch file (CATSExecution.bat) to perform an automated test pass. For more information about the files that are created, see CATS File Reference. The .pvt file that is included in this group of files contains the list of individual tests to run during the test pass. You can manually edit this .pvt file to add your custom collection of tests to run during the test pass.

To manually edit the .pvt file

  1. Browse to the configuration files location that you specified in the CATS Wizard to view the newly created configuration files.

    If you did not provide a location to save the configuration files to, the files are saved to the default location C:\Users\<username>\Compact Test Kit\CATS Configuration folder.

  2. In a text editor, such as Notepad, open the .pvt script file.

  3. Scroll down in the .pvt file to the following text:

    //Users can add their own tests here

  4. Add your custom tests to the area below the text.

    The following code example shows an edited .pvt file section where a user has added the CTK Battery API Tests:

    //Users can add their own tests here
    
    TestName = "Battery API Tests";
            commandString = "s tux -o -d batapitest -x1001,1003,1004";
            commandString = wcea.StringSub.UpdateString(commandString);
            Console.WriteLine("\r\nRunOnDevice: {0}", commandString);
            if (wcea.RunOnDevice(commandString, 20000) == false)
            {
              Console.WriteLine("ERROR Failed to execute target control command!\r\n");
              TestPassed = false;
              goto CLEANUP;
            }
    
            // Wait until tux.exe process has exited
            wcea.WaitForTuxToExit();
    

    To see more examples of how to add test content to the .pvt file, view an existing .pvt file that you created previously by using the CTK. For more information, see CTK Automation Tool Solution (CATS).

  5. Save the edited .pvt file by using the same file name and location as the original file.

Run the Test Pass

After you complete the CATS Wizard and edit the .pvt test script file, you can run the automated test pass.

To run the automated test pass

  1. Browse to the Configuration files location that you specified in the CATS Wizard.

    If you did not provide a location to save the configuration files to, the files are saved to the default location: C:\Users\<username>\Compact Test Kit\CATS folder.

  2. Double-click CATSExecution.bat.

    A command prompt window appears stating that the test pass has begun. When the test pass finishes without errors, a message displays stating that CATS test pass has finished.

You can also run the test pass by using command-line parameters. For more information about the CATS command-line reference, see CATS Command-Line Parameter Reference.

View the Test Results

You can view the test results in the same way whether you ran the test within the CTK or in stand-alone mode. For information, see CTK Automation Tool Solution (CATS).

See Also

Concepts

CTK Automation Tool Solution (CATS)