Forum Discussion

scsvel's avatar
scsvel
Frequent Contributor
14 years ago

Need to get picture from TestLog

Hi all,

I am going to read the TestLog contents from TestComplete test log. Here I am facing problems while getting picture stored in test log.

Ex. My TestLog is as follows..



Suite: App1 

  TestCase1: Check the default mechanisms.    // By expanding the Suite row, we will get this line

     Step-1: Open the particular page. // By expanding the TestCase1 row, we will get this line

     Step-2: Check the page opened and click the Insert Button.  // By expanding the TestCase1 row, we will get this line



Here step-2 line has some error and picture got logged in TC Test log. I need to get the picture to some external file.

I tried this.


  var logs = Project.Logs;

  var logItem = logs.LogItem(0);

  var data = logItem.Data(0); 

  var  suiteRow = logItem.Data(0).Rows(0);

  var caseRow = suiteRow.ChildRow(0);

  var stepRow = caseRow.ChildRow(1);  //This will have Step-2 line data

  var childPic = stepRow.ChildData(0);   //To get the picture object



Here childPic always showing (Null Object) .

But if we try for additional info as below, its working fine.
  var childAddInfo = stepRow.ChildData(1);   //To get the Additional information child object for the selected row.





Can anybody help me what I am wrong? or any other easy methods to get picture from TC Logs...



Thanks ....

  • Hi Shanmugavel,





    In your script, you mention the usage of the ChildData property with an index as a parameter (integer). I guess, you meant ChildDataByIndex as ChildData requires the LogDataScheme object to be passed as a parameter and does not accept integer values.





    Thank you for reporting the problem (impossibility to retrieve a picture from the Picture panel). It will be fixed in a future TestComplete update. Unfortunately, there is no workaround at the moment.
  • scsvel's avatar
    scsvel
    Frequent Contributor
    Thanks alex...



    Can you guide me to retrive the Type column of table rows. If I put ValueByIndex(0)  or ValueByName("Type") its returning some large numbers...

    How can I identify that row has Information or Warning or Error or Event message?



    Thanks in advance...