X-Designer Replay Widget Naming Conventions
X-Designer Replay Widget Naming Conventions
In X-Designer Replay, the widget name is what you use to reference a widget. One of the main tasks for any widget-based testing tool is identifying the right widget. The naming convention must be unambiguous, without being over-complicated.
Here are the rules used by X-Designer Replay:
- If the control is a widget (i.e. not a gadget), and it is the only widget with that name in the current dialog, use the widget name, e.g.
in ApplicationShell
push mywidget
- If the control is a gadget, use parentname.gadgetname
in ApplicationShell
push myradiobox.mytogglebuttongadget
- Where a widget name is null (i.e. ""), use unnamed, e.g.
in ApplicationShell
push myradiobox.unnamed
- Where there are multiple instances of this widget name (or gadget name) in the current shell, then reference the instance by number, e.g.
in ApplicationShell
push mywidget#17
push myradiobox.unnamed#3
push myradiobox#2.unnamed#2
- If you are writing your script by hand, the tree(2) can be used to examine the widget hierarchy:
in ApplicationShell
tree ApplicationShell
This outputs a recursive listing of the widget hierarchy. The listing contains the actual widget name, and in parenthesis, the name you should use for X-Designer Replay, if it is different from the actual name.
- If the shell name is ambiguous, then use instances, e.g.
in myshell#2
push button1
in myshell#3
push button2
Note - the instance numbers are automatically calculated when you record a script. Instance #3 simply means the third occurrence of that name in a depthfirst left to right search of the widget hierarchy for that shell.
See also: