Testing with Python, Perl, Windows or Linux scripts

In Rational® Test RealTime for Eclipse IDE, you can import and execute PTU and OTD test scripts but also other scripts such as Batch (Windows only), Shell (Linux only), Perl or Python.

Before you begin

To be able to run Python (.py files) scripts, you must install the PyDev plugin in Eclipse and configure Python Interpreter preferences. You can download the plug-in from this page https://www.python.org/downloads/.

About this task

This task applies to users who want to test with .bat files (Windows only), .pl files (Perl), .py files (Python), and .sh (Shell for Linux only). You must import the script files in a project to execute them.

Procedure

  1. To import a test script file, proceed as follows: select File > Import and choose General > File System to select the files. You can import these files in any folder at any file structure level.
  2. To configure Python, Perl, Windows or Linux script files, see Configuring Python, Perl, Windows or Linux scripts.
  3. To execute the test script file, use one of the following methods:
    1. To execute a test in a standalone mode in Rational® Test RealTime for Eclipse IDE, right-click the script file and choose Run as > Script test file.
    2. Alternatively, select Run Configurations. In the dialog that opens, under Script test file, select a script file. Right-click and select New to create a new launch configuration. Then proceed as follows:
      • Set a name to your launch configuration.
      • In the Testing Script tab, select your test script file in Select Application panel.
      • Select your configuration in the Configurations panel and click Run. The reports are available into the Test Result folder.
    3. To execute test scripts from a Test Suite in Rational® Test RealTime for Eclipse IDE, see Running a test suite.
      A test report and runtime analysis reports are generated. The reports are available into the Test Result folder. From these files, you can open the appropriate HTML reports.
      Tip: The default execution timeout is set to 20 seconds but some scripts can take more time to execute. You can modify the script execution timeout from Window > Preferences > > installation seettings > installation settings.
  4. To open the reports, select the report file corresponding to your last execution, right-click and select Open With > Test Report.