How to change TestNG deafult test-output directory name

748 views
Skip to first unread message

SPS

unread,
Aug 16, 2016, 5:46:36 AM8/16/16
to testng-users
Hello all,
Each time you run TestNG , it creates a default directory test-output directory. We want to store that directory for each run. For that matter we would like to change the name to test-output+time_stamp otherwise it overwrites.Is there way we can do that.


Thanks

⇜Krishnan Mahadevan⇝

unread,
Aug 16, 2016, 8:13:33 AM8/16/16
to testng...@googlegroups.com
How are you running your tests ? If its via maven, then I think you should be able to define the output directory on the fly via the maven surefire plugin [ please go through its documentation ]

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 Scribbings @ http://rationaleemotions.wordpress.com/

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.

SPS

unread,
Aug 17, 2016, 1:20:55 PM8/17/16
to testng-users
Hello Krishnan,
I am using Maven, I went through Maven documentation . I am not good in Maven , just trying to understand though. According to documentation, I added sure-fire-plugin as follows but not working.
<plugin>
  <configuration>
    <reportDirectory>./test-output/${timestamp}  </reportDirectory>
</configuration>
</plugin>

⇜Krishnan Mahadevan⇝

unread,
Aug 18, 2016, 9:31:25 AM8/18/16
to testng...@googlegroups.com
Sneha,

Something like this should work 

<reportsDirectory>${project.build.directory}/surefire-reports-${maven.build.timestamp}</reportsDirectory>


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 Scribbings @ http://rationaleemotions.wordpress.com/

--

SPS

unread,
Aug 18, 2016, 9:52:52 AM8/18/16
to testng-users
OH, Thanks. This is very helpful


On Tuesday, August 16, 2016 at 4:46:36 AM UTC-5, SPS wrote:
Reply all
Reply to author
Forward
0 new messages