Forum Discussion

jorgesimoes1983's avatar
jorgesimoes1983
Regular Contributor
11 years ago

Access Testcomplete results after running project

Is it possible to access the information identified in the picture after running the project?



I would like access to that data, is it stored in any variables?



The main idea is to access through scripting.

4 Replies

  • jorgesimoes1983's avatar
    jorgesimoes1983
    Regular Contributor
    Tanya's suggestion, creates a detailed report about every test result status, I just wanted to access the summary results, well I kept trying a finally accomplished what I was looking for.



    Maybe it's useful to someone.



    Considerations:

    - you need to install MSXML2

    - you need the path to the last created Log folder on your project, where Description.tcLog resides






    //JScript


    function GetLogDescription(tempFolder){


     


    Log.Message("tempfolder " + tempFolder);


     


    var xDoc, strTmpValue;


    //var tempFolder = "\\\\hisdsk095\\Software\\Logs\\";


    xDoc = new ActiveXObject("MSXML2.DOMDocument");


    xDoc.load(tempFolder + "Description.tcLog");


     


    //User Name


    strTmpValue = xDoc.selectSingleNode('Nodes/Node[@name="root"]/Prp[@name="user name"]/@value').text;


    Log.Message("User Name: " + strTmpValue);


     


    //Computer Name


    strTmpValue = xDoc.selectSingleNode('Nodes/Node[@name="root"]/Prp[@name="computer name"]/@value').text;


    Log.Message("Computer Name : " + strTmpValue);


     


    //Success count


    strTmpValue = xDoc.selectSingleNode('Nodes/Node[@name="root"]/Prp[@name="success test count"]/@value').text;


    Log.Message("Sucess Count : " + strTmpValue);


     


    //Warning count


    strTmpValue = xDoc.selectSingleNode('Nodes/Node[@name="root"]/Prp[@name="warning test count"]/@value').text;


    Log.Message("Warning Count : " + strTmpValue);


     


    //Error count


    strTmpValue = xDoc.selectSingleNode('Nodes/Node[@name="root"]/Prp[@name="error test count"]/@value').text;


    Log.Message("Error Count : " + strTmpValue);


     


    xDoc = undefined;


    }


     


    // get the latest created log folder name


    function ShowFolderList(folderspec)


    {


       var fso, f, fc, s;


       var latest_folder;


       var latest_date='';


       fso = new ActiveXObject("Scripting.FileSystemObject");


       f = fso.GetFolder(folderspec);   


       fc = new Enumerator(f.SubFolders);


       s = "";


       for (; !fc.atEnd(); fc.moveNext())


       {


          // on the first iteration the latest folder is the first


          if(latest_date==''){


            latest_date = fc.item().DateCreated;


            s = fc.item();


          }


         


          // if the next folder is the latest, update


          if(fc.item().DateCreated > latest_date)


          {


            latest_date = fc.item().DateCreated;


            //s = fc.item().Name;


            s = fc.item();


          }


            


          Log.Message(fc.item().DateCreated);


          //s += fc.item();


          //s += "<br>";


       }


       


       Log.Message(latest_date);


       Log.Message("latest log "+ s);


       return(s);


    }