Not Sending updated TestNG Reports in Email after Test Execution

Hi All,

I am Sending an email after the test execution with java code.

using testNG Emailable-report.xml as email body and attachment is an extent report file

here the issue is after completing the test execution sending the emailable report is not current execution report it is taken from previous execution because the folder(Project) is not refreshed.

  1. if i deleted the file manually and execute the test it throws NoSuchFile Exception.
  2. if i called the email method in AfterClass, AfterSuite still it sending old report only

Note: using eclipse i am executing the class as Testng

Please help me how to send the current report in email ?

No idea. Never used. But maybe help you