TEST-NG ERRORS FROM COMMAND LINE

395 views
Skip to first unread message

Rii Rii

unread,
Apr 1, 2021, 5:33:29 AM4/1/21
to testng-users
Hello Everyone,

Please can someone help, I have a very simple testNG project which I am running via intelliJ and its execution is successful.

When I attempt to run this via command line, I see the following errors, how do I manage this?, this is the result on command line I am not sure how to disable these things

C:\Program Files\Java\jdk1.8.0_201\bin>java org.testng.TestNG C:\Users\myUser\IdeaProjects\JAVATestNGProject\testng.xml
[TestHTMLReporter] The system cannot find the path specified

===============================================
setup
Total tests run: 1, Failures: 1, Skips: 0
===============================================

java.io.FileNotFoundException: test-output\testng.css (The system cannot find the path specified)
        at java.io.FileOutputStream.open0(Native Method)
        at java.io.FileOutputStream.open(FileOutputStream.java:270)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
        at org.testng.internal.Utils.writeResourceToFile(Utils.java:465)
        at org.testng.reporters.HtmlHelper.generateStylesheet(HtmlHelper.java:25)
        at org.testng.reporters.SuiteHTMLReporter.generateReport(SuiteHTMLReporter.java:54)
        at org.testng.TestNG.generateReports(TestNG.java:1097)
        at org.testng.TestNG.run(TestNG.java:1022)
        at org.testng.TestNG.privateMain(TestNG.java:1354)
        at org.testng.TestNG.main(TestNG.java:1323)
[Utils] [ERROR] The system cannot find the path specified
java.io.IOException: The system cannot find the path specified
        at java.io.WinNTFileSystem.createFileExclusively(Native Method)
        at java.io.File.createNewFile(File.java:1012)
        at org.testng.internal.Utils.writeUtf8File(Utils.java:111)
        at org.testng.reporters.XMLReporter.generateReport(XMLReporter.java:72)
        at org.testng.TestNG.generateReports(TestNG.java:1097)
        at org.testng.TestNG.run(TestNG.java:1022)
        at org.testng.TestNG.privateMain(TestNG.java:1354)
        at org.testng.TestNG.main(TestNG.java:1323)
[EmailableReporter2] [ERROR] Unable to create output file
java.nio.file.NoSuchFileException: test-output\emailable-report.html
        at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:79)
        at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
        at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
        at sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:230)
        at java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:434)
        at java.nio.file.Files.newOutputStream(Files.java:216)
        at java.nio.file.Files.newBufferedWriter(Files.java:2860)
        at org.testng.reporters.EmailableReporter2.createWriter(EmailableReporter2.java:80)
        at org.testng.reporters.EmailableReporter2.generateReport(EmailableReporter2.java:57)
        at org.testng.TestNG.generateReports(TestNG.java:1097)
        at org.testng.TestNG.run(TestNG.java:1022)
        at org.testng.TestNG.privateMain(TestNG.java:1354)
        at org.testng.TestNG.main(TestNG.java:1323)
java.io.FileNotFoundException: test-output\jquery-1.7.1.min.js (The system cannot find the path specified)
        at java.io.FileOutputStream.open0(Native Method)
        at java.io.FileOutputStream.open(FileOutputStream.java:270)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
        at org.testng.reporters.Files.copyFile(Files.java:50)
        at org.testng.reporters.jq.Main.generateReport(Main.java:85)
        at org.testng.TestNG.generateReports(TestNG.java:1097)
        at org.testng.TestNG.run(TestNG.java:1022)
        at org.testng.TestNG.privateMain(TestNG.java:1354)
        at org.testng.TestNG.main(TestNG.java:1323)

Here my POM configuration:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.12.4</version>
<configuration>
<properties>
<property>
<name>usedefaultlisteners</name>
<value>false</value> <!-- disabling default listeners is optional -->
</property>
<property>
<name>generateTestResultAttributes</name>
<value>false</value>
</property>
<property>
<name>reporter</name>
<value>org.testng.reporters.XMLReporter</value>
</property>
</properties>
</configuration>
</plugin>
</plugins>
</build>

Rii Rii

unread,
Apr 1, 2021, 10:19:50 AM4/1/21
to testng...@googlegroups.com
Hi, If anyone has experienced this issue before please let me know how to resolve it. 

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/249ee8ea-9fee-4798-9877-0482e5bb75e1n%40googlegroups.com.

⇜Krishnan Mahadevan⇝

unread,
Apr 1, 2021, 10:29:11 AM4/1/21
to testng-users
What version of TestNG are you using ?
Please use the latest released version (7.4.0 as of today)

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ https://rationaleemotions.com/


Rii Rii

unread,
Apr 1, 2021, 10:36:04 AM4/1/21
to testng-users
Hi Krish,

I am using <version>7.3.0</version>, then downgraded to <version>6.14.3</version> because it had a bug according to some online threads, the upgraded to <version>7.3.0</version> again.

I will attempt the version you are referring to, thank you for reply

Regards,

Rii Rii

unread,
Apr 1, 2021, 10:59:03 AM4/1/21
to testng-users
I have tried version 7.4.0 and I am still presented with the same errors on command line, any configuration that someone might know of?

On Thursday, April 1, 2021 at 4:29:11 PM UTC+2 Krishnan Mahadevan wrote:

⇜Krishnan Mahadevan⇝

unread,
Apr 1, 2021, 11:12:12 AM4/1/21
to testng-users
There is no special configuration involved. Please share a standalone example of a project that can be used to reproduce the problem and also show us the way in which you are running your tests.


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ https://rationaleemotions.com/

Rii Rii

unread,
Apr 6, 2021, 4:26:01 AM4/6/21
to testng-users
Here is the exact example project that I am using:



Thanks, I intend to integrate a project with Jenkins, so I am first testing a sample project via command line.

Thank you in advance!

⇜Krishnan Mahadevan⇝

unread,
Apr 9, 2021, 1:03:30 AM4/9/21
to testng-users
Cross posting my response for your other thread on the testng-dev group since the solution is the same.


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ https://rationaleemotions.com/

Reply all
Reply to author
Forward
0 new messages