Running a Python harness test

Execute the test that calls the user-scripted action you implemented in the Python harness.

Note: On macOS 10.11 or later versions, you should have installed your own Python interpreter, rather than rely on Apple's pre-installed version (learn more). Assuming that this is the case, ensure that you modify the Python path in the file (in /Applications/TestArchitect/harness_samples/python/) as follows.

You have created a test case that calls the action hello, passing it an argument (Earth, in this example). Prior to that you implemented the action in Python, and created the necessary harness code to direct execution of action hello to your implemented definition of it.
  1. With your test module displayed in the TestArchitect editor, click Execute on the toolbar.
    The Execute Test dialog box appears.
  2. Before clicking Execute, click Automation Tools. The Automation Tools dialog box appears.
  3. Select TestArchitect Python Harness from Playback Tool option.
  4. Click next to the Script(s) field to browse to the file

  5. Click OK to return to the Execute Test dialog box.
  6. Click Execute to run the test.
Upon completion of execution, the Result Details tab of the test results displays the text hello, followed by the value you entered as an argument to the action:

Tip: IDE Users: It is generally recommended that you try out your automation in your IDE (Integrated Development Environment), such as Eclipse. Use the Compile button in TestArchitect’s Execution dialog to set up the necessary information for the test to run. Afterwards, launch the test directly from the IDE. Be sure to set the PYTHONPATH environment variable to the lib/python directory in the TestArchitect program folder. Under Windows, if TestArchitect is installed in the default folder, this would typically be: C:\Program Files\LogiGear\TestArchitect\lib\python
Tip: Developers: Eclipse with PyDev is a good solution for Python. In Eclipse with PyDev, this setting is best set in the project properties. Right click the project node in the Package Explorer, then select Properties. In the Properties dialog select Python - PYTHONPATH. Select the External Libraries tab, and click the Add source folder button.
So far, you have created your own user-scripted action along with a test that runs it, but they have no interaction with the outside world. In the next exercise, you will create a user-scripted action that communicates with a target application.