Forum Discussion

rperneel's avatar
rperneel
Occasional Contributor
13 years ago

Log.Picture

Hello, I am trying to create a suite that will take a screenshot of each different part of the app, and have gotten everything working, but was wondering if there was a way to rename the .png files that are created by Log.Picture to the name of the test unit that called them.  My current idea would require alot of work at the end of the test cycle, and was hoping that there was a way to rename these files as they are generated, instead of the generic Picture1.png.



Thanks.
  • Julia_K's avatar
    Julia_K
    SmartBear Alumni (Retired)

    Hello Ryan,


    Currently, TestComplete does not allow renaming pictures posted to the test log by using the Log.Picture method. However, we have a corresponding suggestion in our database and your request has increased its rating. Thank you for your interest in the product.


    Please let us know if you have any additional questions.

    Good luck.

  • vex's avatar
    vex
    Contributor
    Pinging this thread to count my rating too.  I'd like to see this.  I'd also like to see an easier way to write to the log the current routine.



    As it is now, all my log lines look like







    Would be great to be able to see something like:



  • Julia_K's avatar
    Julia_K
    SmartBear Alumni (Retired)
    Hello Vince,

    Pinging this thread to count my rating too.
    I have increased the rating of the corresponding suggestion. Thank you.



    I'd also like to see an easier way to write to the log the current routine.
    Unfortunately, TestComplete does not allow getting the name of the currently executed script routine. However, we have an appropriate suggestion in our database as well, and your request has increased its rating. Thank you.



    Also, if you are using JScript, C++Script or C#Script in your tests, you can use the following workaround:

    function TestFunction()

    {

      Log.Message(getCallerName());

    }



    function getCallerName()

    {

      return getCallerName.caller.toString().match(/function (\w*)/)[1];

    }




    Thank you for your interest in our product. Good luck.