0

Is there a way to send a mail with result file (I set this file in console command with option --result) after running.

I have run my selenium test cases in following way

How to Schedule Selenium Web Drivers Tests in C#

The result file was created after OneTimeTearDown function.

If sending an e-mail into OneTimeTearDown function - the result file comes incomplete

Thanks in advance Sangeetha P.

1 Answers1

0

I'm not sure I'd actually recommend doing this - but I think it's possible. Personally, I'd instead handle the email sending outside of the NUnit console, in a separate script in your CI System.

Anyway. You could achieve this by writing your own ResultWriter extension. Take a look at the implementation of the standard NUnit3XmlResultWriter as an idea - you'd essentially want the same thing, except to send the file by email, rather than write a file. (You may even want to make your ResultWriter actually inherit the NUnit3XmlResultWriter class.)

Chris
  • 5,882
  • 2
  • 32
  • 57