Forum Discussion

Nimeshika's avatar
Nimeshika
Contributor
9 years ago

Customizing only the image name in defaulted log file .

Hi,

   When I use Log.Picture(Sys.Desktop, MsgString) , after execution that particular image is stored as Picture1.png under the path

C:\Automation\ProjectSuite\TestProject\Log\3_2_2015_2_54 AM_07_935

 

 

Here 3_2_2015_2_54 AM_07_935 is a folder created specifying the time and date of execution. I am fine to have this structure.

 

But inside 3_2_2015_2_54 AM_07_935 folder the images are stored as Picture1.png   picture2.png...

But I want to customize them as Step1.png  Step2.png

 

If I try using ,

NewPict.SaveToFile("C:\Automation\ProjectSuite\TestProject\Log\3_2_2015_2_54 AM_07_935\my_new_image.png");
  Log.Picture(NewPict);

I can fetch only C:\Automation\ProjectSuite\TestProject\Log , this part of address using project.config()

How can I get the 3_2_2015_2_54 AM_07_935 part or the folder name at runtime?

 

 

In short, C:\Automation\ProjectSuite\TestProject\Log\X\my_new_image.png

 

1.How can I get value of X at runtime , X is created by defaultly by test complete to save my log files.

2.I want my images named as Step1.png  Step2.png.

 

 

Regards,

 

   Nimeshika

7 Replies

  • NisHera's avatar
    NisHera
    Valued Contributor

    Rather than using default log folder,

    you can save it to your folder using

     

    SaveToFile Method (Picture Objects) 

    PictureObj.SaveToFile(FileNameConfiguration)

    • Nimeshika's avatar
      Nimeshika
      Contributor

      Hi NisHera,

            Thanks for replying :)

             If I run my project for 100 times then each time I need to create a folder and then save my pictures . This is what you meant?

      If yes, then wouldn't it be an extra unwanted effort when Test complete has capability to create folders in log for each run?

       

       

      Regards,

         Nimeshika

      • NisHera's avatar
        NisHera
        Valued Contributor

        Usually I do not save pictures to log folders
        I created a folder with my own naming convention and save pictures I needed.
        nothing manually, everything done programmaticaly with TC scripts
        may be not best way to your situation.........
        did you do research on "OnLogPicture" Event

  • Hi NisHera,

                 I understood what you told. Thanks for suggestion. But I was searching a way if Test Complete provided an option to name only the images. Anyways if there is no such option then automating the script would be better.

         It would be helpful if  you share the script you use to create a folder with  own naming convention and save pictures.

     

     

    Regards,

       Nimeshika