Forum Discussion

mtilly's avatar
mtilly
Occasional Contributor
12 years ago

Emailing Keyword Test Log

I've scheduled a keyword regression test to run automatically using Windows Task Scheduler and have been searching for a way to automatically email the test results at the conclusion of the keyword test.



I've tried the Call Object Method detailed here:



http://support.smartbear.com/viewarticle/32858/



but it is useless as it exports an xml file with separate icons in gif format.



I would like to email the Keyword Test Log as it appears In the project explorer and do it from a keyword test,  if possible.



Any ideas?  

8 Replies


  • Hi Fester,


     


    I suppose you are using the Log.SaveResultsAs method to export the Test Log. It's possible to change the output format - you need to use the LogFormat parameter for this. Refer to the "SaveResultsAs Method" article for details.


     

  • mtilly's avatar
    mtilly
    Occasional Contributor
    Thank you for your help! 



    I've exported the log as .mht using SaveResultsAs and it looks good. 



    I still need to email it from my keyword test. The information in http://support.smartbear.com/viewarticle/26637/  appears easy but I think this only applies to a coded script. I have not yet found any way to email from a keyword test. 



    Any ideas?
  • mtilly's avatar
    mtilly
    Occasional Contributor
    Hi Tanya,



    I used the SaveResultsAs Operation of the CallObjectMethod to format the log as .mht and save it. It works great! 



    Now my task is to automatically email the log from my keyword test to the boss. 



    http://support.smartbear.com/viewarticle/32858/ mentions 2 ways of doing this:



    running a sequence of keyword operations 



    writing a script routine and running it with the RunScriptRoutine operation



    The second one seems less complicated so I will pursue that. Any advice is greatly appreciated! 













  • mtilly's avatar
    mtilly
    Occasional Contributor
    Hi Tanya, 



    I'm using Run Script Routine at the end of my keyword test to execute the SendMail function as detailed in http://support.smartbear.com/viewarticle/26637/.



     I'm testing the code emailing the log from one of my email addresses to another but I cannot get SendMail to execute. It hangs on the first character of the second line of code. The log entry says simply  "SendMail" and the second line of the following code is highlighted in red:




    Sub EmailLog()


    If SendMail("avalidemailaddress@mycompany.com", "SmartBear-Win7", "Automation Box", "another validemailaddress@mycompany.com", "API Regression Results", "API Regression Results are attached", "C:\Users\CareBear\Documents\API\Results\API_RegressionResults.mht")

    Then


      Log.Message "Mail was sent"


    Else


      Log.Warning "Mail was not sent"


    End If


    End Sub



    Additional Information reads:


    Socket Error # 10061


    Connection refused.



    Any ideas why the connection is refused? 



    Being able to write some simple code and call Run Script Routine to run it in a keyword test is a brilliant idea. I just need to make it work! 



    Thanks - 






  • mtilly's avatar
    mtilly
    Occasional Contributor
    Hi Tanya,



    If you're interested, I have tried Run Code Snippet with the code as follows:



    SendMail("validemail@mycompany.com", "SmartBear-Win7", "Automation Box", "differentvalidemail@mycompany.com", "API Regression Results", "API Regression Results are attached","C:\Users\CareBear\Documents\API\Results\API_RegressionResults.mht")



    The log does not show an error when this executes but it does not email the results log either. 



    I tried BuiltIn.SendMail("same stuff as above") but got the same results - no error but no email either.
















  • Hi Fester,


     


    Have you contacted your network admin regarding the socket issue? 


    Perhaps, sending packages outside your network is prohibited by the admins.