tc_find
Search the UI tree for objects by name, class, or type, or wait until a matching element appears, to locate form controls during 1C test automation.
Instructions
Search the UI tree for objects. In the signatures below a trailing * marks a REQUIRED parameter — the group schema itself accepts every parameter as optional. Actions:
find_object(name=null, cls=null, type=null, root_ref=null, title=null, timeout=0) Find the first object matching the criteria (parameters as in tc_find(action="find_objects")). When nothing matched, the answer carries the same filter diagnostics as tc_find(action="find_objects"). (1C 8.3.3+)
find_objects(name=null, cls=null, type=null, root_ref=null, title=null, timeout=0) Find all objects in the UI tree matching the criteria. name and title take the wildcards * and ?; cls is the class and type is the platform's element kind (both as reported by tc_app(action="get_child_objects"), e.g. CheckBoxField or Popup); root_ref is where to start (default: the active window); timeout keeps retrying for that many seconds while nothing matches (0 = a single pass). An empty result is not an error, so ok stays true. When nothing matched and a cls or type was given, the answer also says whether the server knows that filter and what was actually present, so a misspelling is distinguishable from an object that never appeared. (1C 8.3.3+)
wait_for_object_displayed(name=null, cls=null, type=null, title=null, timeout=60) Poll the UI tree until an object matching the criteria appears, up to timeout seconds. Returns the object, or ok=False on timeout. Criteria as in tc_find(action="find_objects"). On timeout the answer says whether a
clswas seen at all and lists the classes that were actually present, so a misspelled class name is distinguishable from an object that never appeared. (1C 8.3.3+) connection_id selects the client. Passing root_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 root_ref. If a reference expires, find the element again.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cls | No | ||
| name | No | ||
| type | No | ||
| title | No | ||
| action | Yes | ||
| timeout | No | ||
| root_ref | No | ||
| connection_id | No |