0

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)

Areke
  • 56
  • 1
  • 7

1 Answers1

0

I think it would be easiest to save the test visualizers during runtime to a relative location. Then in your script simply parse that one folder.

https://support.smartbear.com/testcomplete/docs/reference/project-objects/test-log/log/saveresultsas.html

"ExportVisualizerImages

Specifies whether to export Visualizer images. Default is True. Use False to reduce the size of the exported log."

mattb
  • 11
  • 1
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/30689828) – Sercan Dec 31 '21 at 10:07