Forum Discussion

OliverWu's avatar
OliverWu
Occasional Contributor
4 years ago

Does SaveResultsAs Junit work?

There is a very simple routine like below. It alwasy fails. All other types of LogFormat works and I can see the file(s) generated. Do I miss something?

 

function test() {  
  Log.SaveResultsAs("C:\\Work\\junit.xml", lsJUnit, false);
}

 

The TestComplete version is 14.70.237.7 x64

  • Hi,

     

    Weird, but I can confirm the problem.

    This code:

     

    function test() {
      Log.Message("Pass");
      Log.Message(Log.SaveResultsAs("D:\\Work\\junit\\", BuiltIn.lsJUnit, false));
    }

     

    posts False as a result of the SaveResultAs() call (which means export failure) and the reason for this is not clear to me at the moment.

    I would suggest to create Support ticket via the https://support.smartbear.com/message/?prod=TestComplete form.

     

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    It alwasy fails.

    Any more details as for what "fails" means?

     

    Try this:

    Log.SaveResultsAs("C:\\Work\\junit\\", lsJUnit, false);

    Does this work?

    If it does, than this is documented in the description of the SaveResultAs method: "The file path (when exporting to XML or MHT) or folder path (when exporting to XML or HTML) to save the log to."

     

    • OliverWu's avatar
      OliverWu
      Occasional Contributor

      Thanks Alex. It means there is nothing generated. No matter the path is folder or file.

       

       

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi,

         

        Weird, but I can confirm the problem.

        This code:

         

        function test() {
          Log.Message("Pass");
          Log.Message(Log.SaveResultsAs("D:\\Work\\junit\\", BuiltIn.lsJUnit, false));
        }

         

        posts False as a result of the SaveResultAs() call (which means export failure) and the reason for this is not clear to me at the moment.

        I would suggest to create Support ticket via the https://support.smartbear.com/message/?prod=TestComplete form.