Forum Discussion
HKosova
Alumni
14 years agoHi Jack,
When you query a web element's attribute using XPath, it returns the attribute object (IHTMLDOMAttribute for IE, Attr for Firefox and so on) rather than the attribute value.
To access the attribute value given the attribute object, you can use its value property:
Or you can query the OPTION element instead and then access its title attribute directly:
When you query a web element's attribute using XPath, it returns the attribute object (IHTMLDOMAttribute for IE, Attr for Firefox and so on) rather than the attribute value.
To access the attribute value given the attribute object, you can use its value property:
/@title")
' Convert to a string
strMenuItem = CStr(MenuItem(0).value)
Or you can query the OPTION element instead and then access its title attribute directly:
")
' Convert to a string
strMenuItem = CStr(MenuItem(0).title)