Ask a Question

TestComplete: Win10: How to read an XML file

SOLVED
jkrolczy
Regular Contributor

TestComplete: Win10: How to read an XML file

I am trying to read an XML file and log out the contents.

 

Going by the example in the TestComplete help,

I get 'Object expected' from using either of the line of code below.

 

// If you have MSXML 4: 

var Doc = getActiveXObject("Msxml2.DOMDocument.4.0");

 

// If you have MSXML 6:  

var Doc = getActiveXObject("Msxml2.DOMDocument.6.0");

 

I am using Win10 OS, and not quite sure if I have MSXML 4: or 6 installed or

even if those are still valid for use on WIn10 ?

 

Does the below code work on Win10 ?

 

 

 

JamesK
2 REPLIES 2
jkrolczy
Regular Contributor

I do have these files on my Win10 computer:

 

jkrolczy_1-1599465506947.png

 

Just do not understand when trying to run the code, why I am getting Object expected.

 

 

JamesK
jkrolczy
Regular Contributor

Figured it out.

 

Looked at syntax for Javascript instead of Jscript:

 

Should be:

 

  1.   // If you have MSXML 4:
      var Doc = Sys.OleObject("Msxml2.DOMDocument.4.0");


      // If you have MSXML 6:
      var Doc = Sys.OleObject("Msxml2.DOMDocument.6.0");

     

     

JamesK
cancel
Showing results for 
Search instead for 
Did you mean: