GetWebElementFromContainer |
Top Previous Next |
×V4.1Ø
Syntax - GetWebElementFromContainer @<Stored Element Name> <Element Type> <Index> <Element Identifier> <Row> <Column> Where: @<Stored Web Element Name> is the user-defined name that is assigned to the variable. <Element Type> is a literal string or a variable that contains a string value. <Index> is an integer or a variable that contains an integer. <Element Identifier> is a valid web element identifier as described in Identifying an Element. <Row> is an integer or a variable that contains an integer. <Column> is an integer or a variable that contains an integer.
Description: This command is used to identify and store an element to be referenced in another web command. There are times when an element is hard to identify - perhaps because the element does not have an ID or name value. If the desired element appears inside of a table, div or span that can be identified, then the element may be referenced in relation to one of these "container" elements. Tables, divs, and spans, are referred to as containers here because they typically have other elements embedded inside of them. Once the desired element has be identified in relation to the container (based on the row and column within the container), it is assigned a stored web element name, which starts with the at sign (@). This <Stored Web Element Name> can be used in any of the web commands that requires an element ID. That is, if the desired action is a click on the element, then the ClickWebElement command can be created with the stored element ID that was created with the GetWebElementFromContainer command. In order to use this command, the container element (table, span, or div) must be identified first using the <Element Identifier>. The Web Script Builder can be used to obtain the element identifier for the container. The <Row> and <Column> parameters indicate the row and column within the container where the desired element appears. Each of these values may be provided as a variable or a hard-coded value. Variables are useful here when iterating through rows or columns. The <Index> parameter indicates within a cell of a container, the index of the desired element. For example, if a desired button appears in row one, column two of a table, the <Index> parameter determines whether the desired element is the first, second, or third button, for example, within that cell. Once all of this information is provided, EMUE has enough information to find the desired element. The result of this command is the creation of a Stored Web Element named by the first parameter in the command.
Soarian SmartUI: Yes Chrome: No
Sample: The following command retrieves a TextBox and stores it in @PtNameTextBox Stored Element Name. @PtNameTextBox is used to identify the text box for the PasteWebValue command. The text box is the first text box that appears within the cell located in row 5 column 7 of the table. GetWebElementFromContainer @PtNameTextBox TextBox 1 "Browser=Main:sframeInner->wellFrame->tabWell*:Table,ID=TransactionTable,INDEX=1" 5 7 PasteWebValue PatientLastName @PtNameTextBox
See Also:
|