GetWebElementAttribute |
Top Previous Next |
×V4.1Ø
Syntax - GetWebElementAttribute <Variable Name> <Attribute Name> <Element Identifier> Where: <Variable Name> is the user defined name that is assigned to the variable. <Attribute Name> is a literal string or a variable that contains a string value. <Element Identifier> is a valid web element identifier as described in Identifying an Element.
Description: This command will retrieve the value of a specific web element attribute, <Attribute Name,> from the element defined by <Element ID>. The resulting attribute is stored in <Variable Name> as defined by the user. This command is useful when trying to determine color, style, alternate text, or any other attribute. At times there are visual cues that cannot be detected in any other way.
Soarian SmartUI: Yes Chrome: No
Sample 1: The following code retrieves the color attribute from the textbox identified and stores it in a variable named ColorOfTextBox. This information might be used to determine if there is an error. GetWebElementAttribute ColorOfTextBox "Color" "Dialog=Main:wellFrame:Textfield,ID=ctlIdentifierInputBoxText__,INDEX=1"
Sample 2: The following retrieves the style attribute from the element identified and stores it in a variable named Style. The style attribute holds multiple pieces of information so the subsequent line examines the value of interest, font-weight, using the LIKE command to see if the text is bold. GetWebElementAttribute StyleInfo "Style" "Dialog=Main:wellFrame:Textfield,ID=ctlIdentifierInputBoxText__,INDEX=1" If StyleInfo Like "*font-weight: bold*" GoTo HandleMessage
See Also:
|