Script project

A Python project contains the programme for an automated test.

Create a new script project

To create a new script project, open the script project service window in the Toolbar of the Python Script module with the new file tool newfile. Select the project type, name and storage location of the project.

createNewScriptProject en
Figure 1. Dialogue for creating a new script project

Now you can add your files to the project.

Adding items to a script project

Right-click on the project in the Project Explorer to open a context menu.

scriptProjectAddElement en
Figure 2. Context menu of the script project

You can select among the following items:

  • Add New Item

  • Add Existing Item

  • Add Existing Folder

Add new item

If you clicked the button Add New Item…​ in the context menu you can select the type of item you want to add and enter the name of the item.

scriptProjectAddNewElement en
Figure 3. Add new item to a script project
Table 1. Possible new items

Empty Python file

Creates a new .py file

Python module

Creates a new .py file with standard header.

Empty Python package (folder and __init__.py file)

Creates a folder with the name of the item. This folder contains a file __init__.py

Folder

Creates a folder.

Set the entry point for the script project

To define the entry point for the script project, a .py file must be selected as the start file.

Procedure:

  1. Select the desired .py file in the Project Explorer

  2. Right-click to open the context menu

  3. Select Set as Start File from the context menu

setAsStartFile en.drawio
Figure 4. Select a .py file in the context menu as the entry point for the script project
To run the script project (.lsproj file), you must select a .py element by selecting Set as Start File.

Releasing the script project

A standard user cannot execute a script project that has not been released. If a file in the project is changed, the release expires and thus it is certain that no testing can be done with a manipulated script. Double-click on the script project (.lsproj file) in the Project Explorer to open the service window for releasing the script project.

scriptProjectVersion en
Figure 5. Releasing a script project

The window displays the history of released test script versions indicating version number, date, user name and a description.

To release a script project (.lsproj file), proceed as follows:

  1. Right-click on the .lsproj file in the Project Explorer to open the context menu

  2. Click on Open

  3. Click on New Version in the service window of the script project.

  4. Enter a short, meaningful description and a new version number in the dialogue and confirm with OK.

scriptProjectNewVersion en
Figure 6. Dialogue for creating a new script project version
Only released script projects (.lsproj file) can be executed by the default user.

Search in the Project Explorer

In the Project Explorer, you can filter for files, classes and functions in a script project.

projectExplorerFiltered de.drawio
Figure 7. Filter for test within the Project Explorer

Options

Storage path of the script project

By default, the script files are stored within the LisRT folder structure at LisRT\Workspace\Script\. You can change path in the main menu at Tools  Options  Environment  Paths.

Options in the Python Editor

The Python editor can be configured in the main menu at Tools  Options  Script  Python Editor.

settingsPythonEditor en
Figure 8. Options in the Python editor