Identifying an Element

Top  Previous  Next

×V4.1Ø

S

A

W

WS

ü

How To Identify An Element

 

When working with web pages, EMUE uses the document object model (DOM) to identify elements on the page.  That is, EMUE accesses the HTML code behind the page in order to find elements rather than basing identification on screen position.  This is a much more robust technique and ensures maximum reliability.  In many cases, web elements will have an ID value or a name.  These attributes make identification of the element easy for EMUE.  There are tools built into EMUE to help identify elements and build commands.

 

Every element on a web page is identified using several parts that are separated by colons:

 

the browser or dialog component that indicates the window in which the element appears.  This component is especially important in Soarian since Soarian frequently opens a new window for search screens.

       Dialog=Soarian

the frame component, which identifies the element's frames leading to where the element appears.  The frame is a section or window on the website and is defined by the Frame tags in HTML.

       wellFrame

the element component, which identifies the element type, an attribute that identifies the element (button, dropdown, link, textbox, etc), and an index value for the position of the element.

       Button,ID=ctlCheckAllButton,INDEX=1

the optional anchor component identifies the anchor type for a reference to where the element appears.

       ->ContainsByID= OR ->Position= OR ->Parent=

 

Together, these components make up a valid element ID and provide EMUE with enough information to find an element on a page.  Fortunately, this string is generated by EMUE and not the user.  This Element Identifier can be represented in four different ways:

 

1.An Element String is a literal string that contains identifying information for the element. EMUE is capable of including variables inside element strings. See Embedded Variables

       Dialog=Soarian:wellFrame:Button,ID=ctlCheckAllButton,INDEX=1

2.A Variable that contains an Element String

                       CheckAllButton

3.A SmartName that references an Element String

                       SearchScreen.CheckAllButton

4.A Stored Element (@StoredElementName)

                       @CheckAllButton

 

In some commands, a Partial Element String is used to identify a subset of elements within another element and can be a literal string or a variable containing a string.  Like an Element Identifier, the Partial Element String includes information to identify the element, but only the element component is included.

       "textbox,Name=txtUsername,Index=2"

 

Using Wildcards in an Element String

Sometimes element identifiers are very long and contain information that is not relevant to identifying the element properly. Some element identifiers may also contain information that changes. This might be seen when using the innertext attribute for identification. A way to work around this limitation is by using a wildcard in the string itself.

 

Sample:

This example uses a wildcard to replace all of the data in a billing period table so that the element will work no matter which receivable group number is being searched.

GetWebTable BPTable "Browser=*Soarian*:sframeInner->wellFrame->tabWell*:Table,InnerText=All billing periods385|,394.00*00205/26/201706/24/2017122|,542.00*00104/26/201705/25/2017262|,852.00,INDEX=1"

GetWebTable BPTable "Browser=*Soarian*:sframeInner->wellFrame->tabWell*:Table,InnerText=All billing periods*,INDEX=1"

 

See Also:

Embedded Variables