Forum Discussion

MW_Didata's avatar
MW_Didata
Regular Contributor
2 years ago

Send log reports to co-workers

Our tests are run every night project by project through Sessioncreate with batchscripting. we have an email message service which logs which projects fail but not the details where or why it failed a.k.a the actual logs.

 

Is there a way to make a toggleable send html logs to email adres of choosing?

The mail looks like this now:

It only shows OK or Errors, not much to go off.

I think running with Testexecute generates an html log when complete, it just want to send this log to my coworkers when needed.

 

I am the only Testcomplete tester for my software, and if I go on vacation I'd like to know the software is being looked after.

  • The command that I use is,

    $tc_timestamp = (Get-Date).ToString('yyyyMMdd_HHmmss')
    $summary_report = "C:\Sandbox\Log\TC_Automation_$tc_timestamp\SummaryReport.xml"
    & 'C:\Program Files (x86)\SmartBear\TestExecute 15\x64\Bin\SessionCreator.exe' RunTest /UserName:Tester1 /password:'Tester1' /UseActiveSession /ScreenResolution:"1920*1080" /ProjectPath:"C:\Sandbox\TestComplete\ALS\ALS.pjs" /ExportLog:"C:\Sandbox\Log\TC_Automation_$tc_timestamp\index.html" /ExportSummary:"$summary_report" | Out-Null

    The log filenames are based on the timestamp, so I keep a record of execution runs/results.

     

    /ExportSummary produces an XML file, which I parse via PowerShell to produce a HMTL report. /ExportLog is the actual log produced by TC. See Command-Line Syntax

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    I also use SessionCreator in my PowerShell script file. I use the following parameters /ExportSummary and /ExportLog. When the Project Suite has completed, an email is sent to the team.

     

    I use /ExportSummary to produce the following email

    at the bottom of the email is a link,

    which takes me to the actual report, where I can see screenshots and diagnose any issues.

    If the team do not wish to receive the email, they can exclude the email notification.

     

    I've kept this whole process as simple as possible.

  • MW_Didata's avatar
    MW_Didata
    Regular Contributor

    The command to run my TC right now is:

    "C:\Program Files (x86)\SmartBear\TestExecute 15\x64\Bin\SessionCreator.exe" RunTest /Username:{myuser} /Password:{mypass} /ProjectPath:"E:\TestComplete 15 Projects\etc.\{myprojectsuite}.pjs" /UA /ScreenResolution:1600*900 /Timeout:9000 /project:"{my project}"

    This command is run for every project in my projectsuite

     

    Adding  "/ExportSummary" or/and "/ExportLog" in that command would do this?

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    It's worth creating a new project suite, with a few projects with dummy tests that have Log.Message, Log.Warning and Log.Error

    You can quickly run through the tests and see the output it generates, using the appropriate command parameters

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    The command that I use is,

    $tc_timestamp = (Get-Date).ToString('yyyyMMdd_HHmmss')
    $summary_report = "C:\Sandbox\Log\TC_Automation_$tc_timestamp\SummaryReport.xml"
    & 'C:\Program Files (x86)\SmartBear\TestExecute 15\x64\Bin\SessionCreator.exe' RunTest /UserName:Tester1 /password:'Tester1' /UseActiveSession /ScreenResolution:"1920*1080" /ProjectPath:"C:\Sandbox\TestComplete\ALS\ALS.pjs" /ExportLog:"C:\Sandbox\Log\TC_Automation_$tc_timestamp\index.html" /ExportSummary:"$summary_report" | Out-Null

    The log filenames are based on the timestamp, so I keep a record of execution runs/results.

     

    /ExportSummary produces an XML file, which I parse via PowerShell to produce a HMTL report. /ExportLog is the actual log produced by TC. See Command-Line Syntax

  • MW_Didata's avatar
    MW_Didata
    Regular Contributor

    Thanks rraghvani  I'll try some of this out, will mark as solved when I get it working so I can ask more questions when needed.

  • MW_Didata's avatar
    MW_Didata
    Regular Contributor

    I tried a new project and the generating works,

    now to get this mailservice to send it is another problem haha.

     

    Thanks rraghvani 

  • MW_Didata's avatar
    MW_Didata
    Regular Contributor

    It hopefully works now, I got my little test project to send it in email by zipping the folder.

    tomorrow I hope all projectlogs will be exported and I'll get myself a nice email.

     

    Thanks for all the help!

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    I store all the logs/results on the dedicated VM that I run TC on,

    Within the email that I send, I just send the network link to the appropriate folder. The team can click the network link and easily view the results. No need to unzip results.