Forum Discussion

JamesG's avatar
JamesG
New Contributor
9 months ago

Emailing Summary Report

Hi all, I have got some python code to create and send an email with an attachment after each test run and it works perfectly. I would now like to add the 'Test Execution Summary'  the the email bu...
  • JamesG's avatar
    JamesG
    9 months ago

    Thanks Rraghvani, I am not using outlook, I am using this code to attach the summary ( the 'Summary.htm' is the test file I was using - 

       # Attach test report file
        attachment_path = 'C:\\Users\\JamesG\\Documents\\Summary.htm'
        with open(attachment_path, "rb") as attachment:
            part = MIMEApplication(attachment.read(), Name="test_report.pdf")
            part["Content-Disposition"] = f'attachment; filename="{attachment_path}"'
            msg.attach(part)

     

    This works but I cant find or figure out how to find the 'Test Execution Summary' for the current run ?