-
Notifications
You must be signed in to change notification settings - Fork 2
Python Support
The framework supports access to:
- The Front Most VI, i.e. the User Interface (controls and indicators) of the front most window
- A SubPanel VI, i.e. the VI loaded in a subpanel within the front most VI
- A SubSubPanel VI, i.e. the VI loaded in a subpanel within the subpanel VI
The methods to access these three categories are encapsulated in the following packages
import lv_ui_testing.front_most_vi as fmv
import lv_ui_testing.sub_panel as sp
import lv_ui_testing.sub_sub_panel as ssp
| Methods | Description |
|---|---|
| click_on_close | Press the close (red cross) button of the window |
The following methods can be called by the three packages; however, their arguments might differ. For example:
# Get the VI name of the front most window
front_most_vi = fmv.get_vi_name()
# Get the VI name of the subpanel called "Sub Panel" (This subpanel should be in the front most window)
sp_vi = sp.get_vi_name("Sub Panel")
# Get the VI name of the subpanel called "Sub Panel Children" which is contained in another subpanel called
# "Sub Panel" (This subpanel should be in the front most window)
ssp_vi = ssp.get_vi_name("Sub Panel","Sub Panel Children")
| Methods | Description |
|---|---|
| click_on_button | Click on a boolean control |
| get_control_details | Get the Caption, Label visibility and Control visibility of all controls |
| get_cluster_details | Get the Caption, Label visibility and Control visibility of all controls within a cluster |
| get_value_xml | Return the XML of a control, recommended way to read a cluster |
| get_vi_name | Get the VI name (of the front most window or loaded in a specific subpanel) |
| resolve_value | Return the value of a control and parse it to its type for python, for example it will return an U32 if the control is of that type (support Numeric, String, Boolean and Array (of the previous types) controls and indicators) |
| set_cluster_elem | Set an element of a cluster |
| set_value_ARR_STR | Set a string array control (for example, a tree control) |
| set_value_BOOL | Set a boolean control (It will not work if it has a latch mechanism !!) |
| set_value_DBL | Set a numeric control |
| set_value_STR | Set a string control |
Prefer the method resolve_value than the following methods:
| Methods | Description |
|---|---|
| get_value | Return the value of the "Anything to string of a specific control" |
| get_value_TREE | Return the value of a tree control |
| get_value_DBL | Return the value of a float control |
| get_value_bool | Return the value of a bool control |
To import the package start your script with the following line:
from lv_ui_testing import ui_testingThe methods are split into two categories:
- FMV : the one for the Front Most Vi
- SP : the one for a VI inside a SubPanel of the front most Vi
The arguments of the different methods are often similar:
- control_label : the label of the control/indicator
- subpanel_label : the label of the subpanel object
Returns the name of the front most VI.
Simulate the click of a User on a button (boolean).
Returns the current value of a control/indicator as a string.
Returns the current value of a control/indicator as a number.
Returns the current value of a control/indicator as a bool.
Set a number (double format) to a control.
Returns the name of the VI inside the subpanel object.
Simulate the click of a User on a button (boolean) in the VI inside the subpanel object.
Returns the current value as a string of a control/indicator in the VI inside the subpanel object.
Returns the current value as a number of a control/indicator in the VI inside the subpanel object.
Returns the current value as a boolean of a control/indicator in the VI inside the subpanel object.
Set a number (double format) to a control/indicator in the VI inside the subpanel object.