Forum Discussion

ray_mosley's avatar
ray_mosley
Frequent Contributor
13 years ago

Programatically Changing location of TestComplete execution logs

When TestComplete is running, you can double click on your project suite name, and a workspace tab with the project suite name appears.  The Properties tab at the bottom of the page allows you to manually specify the TestComplete Log file location for this project suite.



How can I do the same thing programatically?  That is, I want to generate a function to set my log file location.  Pseudo-code for this function would be:

//Function: QASetLogLocation

//Description:

// programmatically establish location of TestComplete execution logs

//Parameters:

// rr (boolean)

//  0 = debug or temporary automated test log (use temporary location)

//  1 = "run for the record" automated test log (use archive location)

//Returns:

// NA

//Preconditions:

//Postconditions:

function QASetLogLocation(rr)

{

  if (rr == 0)

  {

    // set the log file to a local temporary location C:\temp

  }

  else

  {

    if (rr > 1)

    {

      // set the log file to a permanent network archive location

    }

    else

    {

      //parameter error

      Log.Message("Test Development Error passing parameter rr to function QASetLogLocation");

      Log.Message("--expected 0 or 1; received \"" + rr + "\"");

      // I would like to terminate TestComplete test execution here

    }

  }

  return;

}



  • VLapidus's avatar
    VLapidus
    Frequent Contributor
    No way changing project suite log location from script. However, you can use Log.SaveResultsAs to export the log to the needed location.
  • ray_mosley's avatar
    ray_mosley
    Frequent Contributor
    Log.SaveResults was suggested; however, that is not our answer.

    An enhancement request for this feature has been submitted to SmartBear.