Error while Sending Email

26 views
Skip to first unread message

Sandip Mukherjee

unread,
Oct 2, 2015, 2:26:35 PM10/2/15
to Selenium Users
I am running a Selenium Test.All the tests are running fine but when I am trying to send the completion mail It is giving error.The code is running fine when I am locally running through VS2015 but returning error when I am running from TeamCity.

I am using C# and Chromedriver as a technology stack.

The code is returning below error.

**Diplomat.Enav.Web.Selenium.Tests.dll: Diplomat.Enav.Web.Selenium.Tests.GlobalFixture 
TearDown method failed. One or more errors occurred.
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout)
   at Diplomat.Enav.Web.Selenium.Tests.Common.Mailer.SendResults(List`1 states, Boolean waitForCompletion) in d:\TeamCity\buildAgent\work\a367a3eda4cbbd88\Diplomat.Enav.Web\Diplomat.Enav.Web.Selenium.Tests\Common\Mailer.cs:line 59
   at Diplomat.Enav.Web.Selenium.Tests.Common.SeleniumStatus.SendCompletionEmail() in d:\TeamCity\buildAgent\work\a367a3eda4cbbd88\Diplomat.Enav.Web\Diplomat.Enav.Web.Selenium.Tests\Common\SeleniumStatus.cs:line 182
   at Diplomat.Enav.Web.Selenium.Tests.GlobalFixture.RunAfterAnyTests() in d:\TeamCity\buildAgent\work\a367a3eda4cbbd88\Diplomat.Enav.Web\Diplomat.Enav.Web.Selenium.Tests\Common\GlobalFixture.cs:line 39**

The code which is giving this error is 

 Task sendMailTask = smtp.SendMailAsync(message);
    
            if (waitForCompletion)
                  sendMailTask.Wait(5000);

When it is executing "sendMailTask.Wait(5000)" it is returning error.





Mark Collin

unread,
Oct 5, 2015, 7:03:39 AM10/5/15
to Selenium Users
This is really nothing to do with Selenium, and doesn't really belong in this forum.

At a guess you don't have something installed on the build agent that is installed on your local machine.
Reply all
Reply to author
Forward
0 new messages