tc_form
Control and inspect managed forms in 1C:Enterprise test clients: navigate elements, read focus, check modified status, execute choices, and wait for window closure.
Instructions
Actions on the managed form itself, including navigation between form elements and reading the focused element. Choose action.
Common operations for objects of this type live elsewhere: tc_field(action="is_visible"), tc_field(action="is_enabled"), tc_field(action="get_context_menu"), tc_app(action="get_parent").
In the signatures below a trailing * marks a REQUIRED parameter — the group schema itself accepts every parameter as optional.
ok: true means the client accepted the command, not that anything changed — confirm an effect by reading the state back; target_check: present is not proof of one either. Where the address can be checked the response carries target_check: present, unknown (not checkable here) or off (checking disabled). target_hidden: true appears ONLY when the target exists and was NOT visible; it does NOT prove the absence of an effect — for tc_field(action="activate") invisibility is the normal precondition — it describes the ELEMENT itself and not an invisible container around it, and its absence says nothing. A wrong address is refused with an error only where the address can be checked: a read without a target marker cannot tell one from an empty answer, and tc_table(action="get_cell_text") on a table that does not exist returns text=null exactly as for an empty cell.
Actions:
current_modified(ref*) Whether a form has been modified. (1C 8.3.3+)
execute_choice_from_list(ref*, index*) Pick an item from a modal choice list by 0-based index or display text. Not a field's drop-down (use tc_field(action="choose_from_drop_list")). ref: the form (ManagedForm), not a field. (1C 8.3.8+)
execute_choice_from_menu(ref*, index*) Pick an item from an OPEN menu by 0-based index or display text; nested submenus are not supported. This works for a menu the form put up, and for the menu a spreadsheet document raises over a cell that has DETAILS — address the form or the field, either reaches the menu that is open. It selects from a menu that is ALREADY open: if none is, nothing happens. On a spreadsheet-document field this needs platform 8.3.25 or newer. (1C 8.3.8+)
find_default_button(ref*) Find the form's default button. ref is the form's ref. (1C 8.3.3+)
get_current_element(ref*) Get the managed form's focused element as item: [{ref}]. ref: the form (ManagedForm). The platform can return no current element after navigating out of its fields.
goto_next_element(ref*) Move focus to the next element in the managed form's tab order. ref: the form (ManagedForm). This can finish the current field's pending input; read the field's data presentation to verify acceptance. Reference fields may still require choosing a value.
goto_previous_element(ref*) Move focus to the previous element in the managed form's tab order. ref: the form (ManagedForm). This can finish the current field's pending input; read the field's data presentation to verify acceptance.
wait_for_closing(window_title=null, timeout=60) Wait until a window closes, up to timeout seconds. Without window_title it watches the window that is active AT THE MOMENT OF THE CALL, so it only makes sense BEFORE the action that closes something; called after tc_window(action="close_window") it is already watching the next window and will time out while reporting the window is still open. After a close, pass window_title — the title is taken from the window's managed form, and if it cannot be determined the call says so instead of claiming the window closed. (1C 8.3.3+) connection_id selects the client. Passing ref selects the client automatically; otherwise, with several clients, connection_id is required. Use tc_session(action="list_connections"). Pass reference values returned by the tools unchanged in ref. If a reference expires, find the element again.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | ||
| index | No | ||
| action | Yes | ||
| timeout | No | ||
| window_title | No | ||
| connection_id | No |