Forum Discussion

rrubio's avatar
rrubio
Contributor
13 years ago

Is there a way of doing by code the manual 'Export to' at Project level?



Hi all,



I have seen some posts regarding this issue.

Anyway, in my case, automated testing is integrated in a daily build project. At the end of testing, it has to send a mail with the final result: OK, NOT OK and export testing results to a .mhtml file.



As this execution test is formed by several test items, with Log.SaveResultAs functions we only have the results for current item (at this point I could export it to a file)  (and so on with each test item).



However, this will generate as many export files as test items.



From TestComplete I can open the testlog and export all items execution files in a single .mhtml file



Is it possible to redo this by code? Or is it possible to load any single log file result, "pack them" in a single composed log and then export it?





Thanks for everything.



Raul

14 Replies

  • AlexeyK's avatar
    AlexeyK
    SmartBear Alumni (Retired)

    Yabing,


    Your MyFinalResult.xml file contains information on the total number of warnings and errors:




    <Node name="root">

      ...

      <Prp name="warning count" type="I" value="1"/>

      ...

      <Prp name="error count" type="I" value="86"/>


    As for other metrics, you need to find the {GUID} file that contains summary data. For instance, in the archive you sent these are the {A5FBDAA3-CCAF-4A7A-89DB-41C6765D6EC5} and {AB7C19FF-1817-46CD-BFD5-CE432F2E4EED} files.

    Each of these files has the summary node (see below). The file also contains nodes that store various summary values:




    {summary file}


    <Node name="summary">

      <Node name="failed">

        <Prp name="total" type="I" value="31"/>

        <Prp name="total (sum)" type="I" value="31"/>

        ...

      </Node>

      <Node name="passed">

        <Prp name="total" type="I" value="238"/>

        <Prp name="total (sum)" type="I" value="238"/>

        ...

      </Node>


    If you need other specific results, you have to parse the XML data and find the needed values.


    An easier approach, perhaps, is to work with log data from scripts. See Scripting Access to the Test Log Contents.

  • yabing_yang's avatar
    yabing_yang
    Occasional Contributor
    Hi Alex,



    Thank you very much for the detail. NOW I understand it. :)



    Regards,

    Yabing
  • yabing_yang's avatar
    yabing_yang
    Occasional Contributor
    BTW, how to turn off ExportVisualizerImages?



    Log.
    SaveResultsAs(FileName
    LogFormat
    ExportVisualizerImages)
    Parameters

































    FileName [in] Required String
    LogFormat [in] Optional Integer
    Default value: lsXML
    ExportVisualizerImages [in] Optional Boolean
    Default value: True
    Result     Boolean  



    I try to use Log.
    SaveResultsAs(FileName
    LogFormat
    , False).

    or                   Log.
    SaveResultsAs(FileName
    LogFormat
    , 0)            

     TestComplete throws an exception (please see an attachment).
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    i wonder if it could be that the problem is not in the third parameter but in the other two?  What values are you passing in for the filename and log format?