When I am running the tesng.xml
file by running it by right clicking on it ,the emailable-report.html
file is showing as per the latest test result ,but While running it from terminal by "mvn test
" test results are coming as per expected but emailable-report.html
file is updated as per the current result .
Asked
Active
Viewed 4,687 times
4

Sidhartha
- 988
- 4
- 19
- 39
-
I think your question and description causing conflict. What you want is not clear – Trimantra Software Solution May 25 '17 at 09:06
-
@Sidhartha `test results are coming as per expected` so where is the problem? Thanks – undetected Selenium May 25 '17 at 09:07
-
@Dev While running with "mvn test" ,emailable-report is not getting updated with current test results . – Sidhartha May 25 '17 at 09:10
-
@Sidhartha Can you consider showing us your work please? Thanks – undetected Selenium May 25 '17 at 09:14
-
@Dev I have attached the screenshot please check.Actually while running the selenium code through maven the testng emailable file is not getting updated as per the result . – Sidhartha May 25 '17 at 09:17
-
@Sidhartha I think once maven is done with the Test, you need to refresh your Project `DataVisualization` once to get the fresh reports – undetected Selenium May 25 '17 at 09:24
-
But wait, why don't you copy the `emailable-report` to `target` where maven works at its best? Thanks – undetected Selenium May 25 '17 at 09:26
-
emailable-report is within the "test-output" folder ,which is the default folder structure . – Sidhartha May 25 '17 at 09:30
-
Tell me first, did you refresh your Project `DataVisualization` once to get the fresh reports? Are you seeing them with fresh data & formatting? Thanks – undetected Selenium May 25 '17 at 09:36
-
Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/145111/discussion-between-sidhartha-and-dev). – Sidhartha May 25 '17 at 09:40
-
If you're still having problems, you might want to try a mvn clean – Bill Hileman May 25 '17 at 14:12
-
@Sidhartha : delete the report and try again – Kushal Bhalaik May 25 '17 at 15:36
-
Use IExecutionListener and call sendmail method from onExecutionFinish() method.It will definetely send latest emailable report. – Kalyani Pagare May 18 '20 at 13:03
2 Answers
7
That's because your report is probably generated in target folder when you run it with maven and in test-output when running it via testng.xml directly. So you are probably expecting it to be in different place and you are opening wrong report, while your latest report is in target folder.

acikojevic
- 915
- 1
- 7
- 16
-
1
-
-
1Thank you .I got it int location "target/surefire-reports/testng-native-results/emailable-report.html" – Sidhartha May 26 '17 at 06:55
0
I had the same problem, but the folder was ok. The problem is that the emailable-report.html generation occurs after all the execution, including the annotations @After.... What I did is using Reporter.getCurrentTestResult(); in @AfterTest before performing the email send action to have the file updated at the right time.