Send a report on the failure of the autotest to the mail

English version ›› Mail ››
Parent Previous Next

Send a report on the failure of the autotest to the mail


The connection to the mail server is configured in the "Project" window.

This example uses a Yandex mailbox.



To use the function of sending a report to the mail, you need to enable this option in the autotest using the method BrowserEnableSendMailAsync


        public async Task setUp()
        {
            await tester.BrowserEnableSendMailAsync(true, false); // only in case of failure
            await tester.BrowserEnableSendMailAsync(false, true); // only if successful
            await tester.BrowserEnableSendMailAsync(); // in both cases
        }


In case of failure, a report of the following type will be sent to the listed email addresses



The email will include a screenshot at the time of the error and a report with the steps of execution, as well as user messages.





You can send an email at any time, you need to use the function SendMsgToMailAsync


        public async Task tearDown()
        {
            if(tester.GetTestResult() == Tester.PASSED) 
            {
                await tester.SendMsgToMailAsync("Text message", "The test was completed successfully");
            }
        }


Created with the Personal Edition of HelpNDoc: News and information about help authoring tools and software