title: Parse JSON file using VBScript - QTP/UFT
body: <p>I am using QTP/UFT for automating my UI application. I would like to compare the UI values with the values from the REST API response. I'm new to VBScript and I have coded the method to call the REST API and get the response but i'm trying to find a solution how to parse the JSON using VBScript.</p>
  
  <p>Please  help me how i could parse the json response? (Code below)
  OR if it's easier to accept the REST response in xml and parse it in VBS?</p>
  
  <p>Appreciate your help and ideas. Thanks! </p>
  
  <pre><code>userName    =   "abc@xyz.com"
  password    =   "blah.123"
  acctNumber  =   "01999994201"
  
  URL1="https://CXaic-blah.blah.ocp.blah.com:243/ic/api/integration/v1/flows/rest/blah_ACCNTSEARCH/1.0/accountSearch?accountNumber=" 
  URL=URL1&amp;acctNumber
  Set objXmlHttpMain = CreateObject("Msxml2.ServerXMLHTTP") 
  on error resume next 
  objXmlHttpMain.open "GET",URL, False , userName, password
  objXmlHttpMain.setRequestHeader "Accept", "application/json"
  objXmlHttpMain.setRequestHeader "charset", "UTF-8"
  objXmlHttpMain.send
  
  restjsonresp    =   objXmlHttpMain.responseText
  </code></pre>
  
  <p>Below is the format of the json response i get:</p>
  
  <pre><code>{ 
     "searchResponse":{ 
        "element":[ 
           { 
              "accType":"R",
              "accountNumber":"1111111",
              "accountStatus":"A",
              "taxId":""
           }
        ]
     }
  }
  </code></pre>