getting XML DOM tagName fails
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2020
01:02 PM
03-30-2020
01:02 PM
getting XML DOM tagName fails
Microsoft XML DOM Properties page shows "tagName" as a property. But when I try to use it with
# Python Log.Message("Node tag: " + mynode.tagName)
I get "AttributeError: The object does not support this property or method"
I can use "nodeName", "nodeValue", "xml", "text", or various other properties with no problem.
Indeed, the "xml" property shows the tag name and the value.
But how do I get just the tagName? Why doesn't it work, or why is it not supported?
Solved! Go to Solution.
3 REPLIES 3
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2020
01:17 AM
03-31-2020
01:17 AM
Tried this:
function testTagName() { let a = Sys.Browser('*').Page("https://community.smartbear.com/t5/TestComplete-General-Discussions/getting-XML-DOM-tagName-fails/m-p/199506").Panel(1).Panel(0).Panel(0).Panel(0).Panel(0).Panel(0); Log.Message("TagName = ", a.tagName); }
And it worked, give me DIV
So by TC it's ok.
Do you load an external XML ? with which method and which driver ?
Un sourire et ça repart
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2020
10:01 AM
03-31-2020
10:01 AM
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2020
03:05 PM
04-01-2020
03:05 PM
This finally worked for me:
# this "mynode" is the parent of the node with the text value # 0 indicates an Element # This may need refining if the Element node has qualifiers within it if aqObject.GetVarType(myNode.nodeValue) == 0: tagName = aqConvert.VarToStr(myNode.nodeName) subNode = myNode.childNodes[0] myvalue = aqConvert.VarToStr(subMode.nodeValue) Log.Message("tagName " + tagName + " has value " + myvalue)
