Ask a Question

Testcomplete: how to get captured screenshot from 'Picture' panel in logs

Arman
New Contributor

Testcomplete: how to get captured screenshot from 'Picture' panel in logs

I'm generating own log export to pdf by using fpdf. I'm trying to get captured screenshot after click from 'Picture' panel in 'Test Log'. I could get name and status from 'Log Items'. I've tried to check 'Picture' panel's DataType, but it returns 'float' instead of 'image'

logsCol = Project.Logs
logItem = logsCol.LogItem[0]
num = logItem.ChildCount

if num > 0:
  for i in range(0, num):
    name = logItem.Child[i].Name
    status = logItem.Child[i].Status

    #checking 'Picture' panel data type
    #here need to get captured screenshot
    screenType = logItem.Child[3].Data[0].Scheme.Child[0].DataType

    data = [[name, screenType, status]]
  
    #adding data to table
    for row in data:
      for datum in row:
        pdf.cell(3.7, 2*th, str(datum), border=1)
      pdf.ln(2*th)

pdf.output('Path to exported log\\TestReport.pdf', 'F')

Is it possible to get screenshot from TestComplete? (the option to get from the log folder is not suitable)

2 REPLIES 2
hkim5
Staff

https://support.smartbear.com/testcomplete/docs/testing-with/log/working-with/from-tests.html

this is probably the best help that i can give you at the moment for parsing testlogs for pictures, where the code snippet at the bottom of the doc should give you some idea of how to access the pictures (specifically the function ExportPicture() )

Best,
Justin Kim
Arman
New Contributor

Thanks for answer Justin, I will try this way

cancel
Showing results for 
Search instead for 
Did you mean: