Working with the Python harness

How to implement TestArchitect actions using the Python programming language.

This subsection contains two exercises that demonstrate how to create user-scripted actions implemented in the Python programming language, and how to access such actions in your tests.

Supported OS environments

  • Windows
  • Linux

Supported Python version

  • Python 2
  • Python 3

Installing a Python interpreter

TestArchitect installation does not include a Python interpreter, which is a requirement for running Python scripts.

  • Linux: Linux machines come with Python 2.x pre-installed.
  • Windows: Windows does not, by default, include a Python interpreter. You may, however, easily obtain a free interpreter from the Python Releases for Windows page of python.org.

In addition, please observe the following when installing an interpreter:

  • Use a Python interpreter that is no older than 3.x. (TestArchitect has a set of import files that expose the automation library objects and functions to the interpreter. These files assume a Python version of 3.x.).
  • Both TestArchitect and the Python interpreter must be for the same machine architecture (64-bit).

Before proceeding…

Please ensure that you have Python installed before proceeding with the following examples. In addition, your system’s PATH variable must be set to include the path to the Python executable: for example, C:\Python.

Developing your own User-scripted Python harness action
To created a scripted Python action, you must define the action, and modify the existing harness files to implement it.

Scripting an action in Python
Implement an action in Python, using the TestArchitect Python harness.

Creating the test case and stub action
Create a stub action in TestArchitect as a placeholder for thescripted hello actionyou defined previously, then write a test to invoke the action.

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

User-scripted Python harness action that interacts with GUI
In this exercise, we create a Python-scripted action that interacts with an AUT’s user interface.


Copyright © 2024 LogiGear Corporation. All rights reserved. LogiGearはLogiGear Corporationの登録商標であり、Action Based TestingおよびTestArchitectはLogiGear Corporationの商標です。ここに記載されているその他の商標は、各所有者の財産です。

LogiGear Corporation

1730 S. Amphlett Blvd. Suite 200, San Mateo, CA 94402

Tel: +1 (650) 572-1400