Element Strings and References |
Top Previous Next |
×V5.3Ø
Element String Structure
Element strings are basically search queries on the form(s) you see. It's important to note Millennium Element strings have their own format. They are similar to element strings for web scripting, but there are differences.
What we have now is:
OpenApp RevCycle "C:\Program Files\Cerner\RevCycle.exe" ClickElement RevCycle "Element[Name=File|Type=MenuItem]" ClickElement RevCycle "Element[Name=New|Type=MenuItem]"
These strings are simpler than web scripting strings. While Index is supported, 1 is the default so it’s not necessary to add it unless you want something other than 1. Syntax is more flexible, the field names are not case sensitive (Name vs name) only the values are.
Parent Reference
References (or anchors) are not a new concept. They are used when the element you want to interact with is not well identified. We support a parent reference and position reference. A parent is the container for the element you want. An example would be a table (parent) and a tablecell (the element you want).
This example would click the first button labeled OK on the Dialog who’s title is “Are you sure?”
ClickElement RevCycle "Reference[Parent|Name=Are you sure?|Type=Dialog]Element[Name=OK|Type=Button]"
A general rule for using this is if you have an index that is greater than 1. The smaller the index the better.
Standard Element String "Element[Name=First|Type=Edit|Index=2]"
Parent Reference "Reference[Parent|Name=Patient|Type=Pane]Element[Name=First|Type=Edit]"
While that is longer, it is more explicit and less break-able if something changes. A parent reference will only be available if the parent of the desired element has a valued Name attribute.
If there is no name available on the parent and the index is greater than 1, consider using a position reference.
Position Reference
Position references are a good option to use if there desired element or parent do not have a valued Name attribute. The most common use for these are for controls that have a label in front of them to describe an edit field. Examples would be a Date of Birth, First Name, Last Name, etc.
Standard Element String "Element[Type=Edit|Index=10]"
Position Reference "Reference[Position|Name=First Name:|Type=Text]Element[Type=Edit]"
Since the standard element string has a high index value and edit control doesn't have a name, we can use a position reference. Here we are looking for the Text field with a name of "First Name:" and then the first Edit control after that Text field. An index will be added if necessary. Otherwise, the default is 1.
Wildcards
The biggest reason to use this is the names of things are their text, so if you want to just click File > New you may see text to the far right of New that says Ctrl+N which is explaining it's shortcut and that is part of the name, with an unknown number of spaces or tab in between them. So instead of saying:
Standard Element String ClickElement RevCycle "Element[Name=New Ctrl+N|Type=MenuItem]"
With a wild card ClickElement RevCycle "Element[Name=New*|Type=MenuItem]"
Wildcards support an index other than 1. Wildcards are slower than the exact name, so don't use them unnecessarily. Also, in order to use an actual asterisk in a name (ex: some things have an asterisk in front to mark that they are required) then just use a double asterisk and instead of searching, it will parse it as a single asterisk, like so:
GetValue RevCycle "Element[Name=**Appointment Name|Type=Edit]" |