Forum Discussion

nancy_arias's avatar
nancy_arias
Occasional Contributor
11 months ago
Solved

Emailing failed test log after test execution

Hi, i'm monitoring a web system throw an authomation script using Keyboard test. So i want to send an email when the test execution results on a failure.

I saw the documentation but still i cant get it... can someone kindly help me!

  • In this example,

    When I run Test1, to purposely cause an error. The event OnLogError() is triggered automatically, and then the Log.Error() message is shown afterwards. Make sure you fully understand how Events are triggered.

     

    To send an email, follow the example shown in Sending Email From Scripts. Depending on your email system (SMTP), you might not be able to send an email using an external application. You have to test this though.

     

    You can then incorporate the above into your keyword tests.

5 Replies

    • nancy_arias's avatar
      nancy_arias
      Occasional Contributor

      I add the Event, and choose the OnLog Error Event

      and then it creates a keyword test with "OnLogError_OnLogError", I add the call object method BUILT IN to use the SendEmail operation

       

      but then what is the next step?

       

      • nancy_arias's avatar
        nancy_arias
        Occasional Contributor

        rraghvani 

        I convert the keyword where I have the builtIn send email operation to script, and then I add the run script routine to call the script (BuiltIn Send email), but i didnt recieve the email...

         

         

         

        Also Im running a keyword test that I'm forcing to result on error execution to test the scenario of "OnLogError"

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    In this example,

    When I run Test1, to purposely cause an error. The event OnLogError() is triggered automatically, and then the Log.Error() message is shown afterwards. Make sure you fully understand how Events are triggered.

     

    To send an email, follow the example shown in Sending Email From Scripts. Depending on your email system (SMTP), you might not be able to send an email using an external application. You have to test this though.

     

    You can then incorporate the above into your keyword tests.