Identifying an Element |
Top Previous Next |
×V4.1Ø
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:
Dialog=Soarian
wellFrame
Button,ID=ctlCheckAllButton,INDEX=1
->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:
Dialog=Soarian:wellFrame:Button,ID=ctlCheckAllButton,INDEX=1
CheckAllButton
SearchScreen.CheckAllButton
@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:
|