testng-team / testng

TestNG testing framework
https://testng.org
Apache License 2.0
1.99k stars 1.02k forks source link

XMLReporter listener cannot find file #591

Closed rab2215 closed 9 years ago

rab2215 commented 9 years ago

Since encountering an earlier issue I reported (testNG not creating HTML report #562), which causes the html report to not be generated(and as a result my custom html reporter doesn't get executed), I decided to disable the default listeners and only enable the XMLReporter (since Jenkins requires it for the testNG plugin to report results) as well as my custom listener as shown below.

usedefaultlisteners false listener org.testng.reporters.XMLReporter, com.theyTookOurJobs.MyCustomListener

When running this configuration, I receive this error:

java.io.FileNotFoundException: C:\SeleniumNavigation\selenium-grid-service\targe t\surefire-reports\testng-results.xml (The system cannot find the path specified ) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.(FileOutputStream.java:221) at java.io.FileOutputStream.(FileOutputStream.java:171) at java.io.FileWriter.(FileWriter.java:90) at org.testng.internal.Utils.writeUtf8File(Utils.java:107) at org.testng.reporters.XMLReporter.generateReport(XMLReporter.java:66) at org.testng.TestNG.generateReports(TestNG.java:1115) at org.testng.TestNG.run(TestNG.java:1074) at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.ja va:91) at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMult i(TestNGDirectoryTestSuite.java:204) at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(Tes tNGDirectoryTestSuite.java:107) at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider .java:113) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameCla ssLoader(ForkedBooter.java:200) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(Fork edBooter.java:153) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java: 103)

I have run this without my listener as well so I know that's not this issue, am I missing a dependency that the XMLReporter needs or is there something else going on here?

juherr commented 9 years ago

Can be closed, duplicate of #592