I was wondering if there is anyway that I can get the total runtime of
a test from testng-results.xml. I did see the duration-ms attribute of
test-method but simply adding all of them will not give me correct
time since we run our tests in parallel.
Thanks
Mikkin
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
-Mikkin
On Mar 9, 1:27 pm, Todd Wells <ttopwe...@gmail.com> wrote:
> I think this would be useful information to have in testng-results.xml.
>
> 2010/3/9 Cédric Beust ♔ <cbe...@google.com>
>
> > You're right that you probably can't derive this information from
> > testng-results.xml, but you could measure this with
> > @BeforeSuite/@AfterSuite methods...
>
> > Of course, we could probably also add a <start-time> and <end-time> to
> > testng-results.xml...
>
> > --
> > ***Cédric
> > *
>
> > On Tue, Mar 9, 2010 at 1:13 PM, mikkin <mikkinpa...@gmail.com> wrote:
>
> >> Hi,
>
> >> I was wondering if there is anyway that I can get the total runtime of
> >> a test from testng-results.xml. I did see the duration-ms attribute of
> >> test-method but simply adding all of them will not give me correct
> >> time since we run our tests in parallel.
>
> >> Thanks
> >> Mikkin
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "testng-users" group.
> >> To post to this group, send email to testng...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> testng-users...@googlegroups.com<testng-users%2Bunsu...@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/testng-users?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "testng-users" group.
> > To post to this group, send email to testng...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > testng-users...@googlegroups.com<testng-users%2Bunsu...@googlegroups.com>
Thanks Cosmin and Cedric! :)
-Mikkin
On Mar 10, 9:20 am, Cédric Beust ♔ <cbe...@google.com> wrote:
> Cosmin just implemented this for you:
>
> <suite name="TestNG JDK 1.5" duration-ms="35041"
> started-at="2010-03-10T09:15:36Z" finished-at="2010-03-10T09:16:11Z">
>
> Available in the beta: http://testng.org/beta
>
> Thanks, Cosmin!
>
> --
> ***Cédric
> *
>
> On Tue, Mar 9, 2010 at 1:27 PM, Todd Wells <ttopwe...@gmail.com> wrote:
> > I think this would be useful information to have in testng-results.xml.
>
> > 2010/3/9 Cédric Beust ♔ <cbe...@google.com>
>
> >> You're right that you probably can't derive this information from
> >> testng-results.xml, but you could measure this with
> >> @BeforeSuite/@AfterSuite methods...
>
> >> Of course, we could probably also add a <start-time> and <end-time> to
> >> testng-results.xml...
>
> >> --
> >> ***Cédric
> >> *
>
> >> On Tue, Mar 9, 2010 at 1:13 PM, mikkin <mikkinpa...@gmail.com> wrote:
>
> >>> Hi,
>
> >>> I was wondering if there is anyway that I can get the total runtime of
> >>> a test from testng-results.xml. I did see the duration-ms attribute of
> >>> test-method but simply adding all of them will not give me correct
> >>> time since we run our tests in parallel.
>
> >>> Thanks
> >>> Mikkin
>
> >>> --
> >>> You received this message because you are subscribed to the Google Groups
> >>> "testng-users" group.
> >>> To post to this group, send email to testng...@googlegroups.com.
> >>> To unsubscribe from this group, send email to
> >>> testng-users...@googlegroups.com<testng-users%2Bunsu...@googlegroups.com>
> >>> .
> >>> For more options, visit this group at
> >>>http://groups.google.com/group/testng-users?hl=en.
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "testng-users" group.
> >> To post to this group, send email to testng...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> testng-users...@googlegroups.com<testng-users%2Bunsu...@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/testng-users?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "testng-users" group.
> > To post to this group, send email to testng...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > testng-users...@googlegroups.com<testng-users%2Bunsu...@googlegroups.com>
. For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
-- You received this message because you are subscribed to the Google Groups "testng-users" group. To post to this group, send email to testng...@googlegroups.com. To unsubscribe from this group, send email to
public class TimeKeeper implements ISuiteListener {
public static final String pattern = "dd/MM/yyyy HH:mm:ss SS";
public static final SimpleDateFormat format = new SimpleDateFormat(pattern);
@Override
public void onStart(ISuite suite) {
}
@Override
public void onFinish(ISuite suite) {
long totalTime = 0;
for (ISuiteResult eachResult : suite.getResults().values()) {
ITestContext ctx = eachResult.getTestContext();
Date start = ctx.getStartDate();
Date end = ctx.getEndDate();
long ms = end.getTime() - start.getTime();
totalTime += ms;
System.err.println(ctx.getName() + " started at [" + format.format(start) + "] and "
+ "ended at [" + format.format(end) + "] and took [" + ms + "] ms to run.");
}
System.err.println("Total time taken = " + totalTime + " ms");
}
}
. For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
-- You received this message because you are subscribed to the Google Groups "testng-users" group. To post to this group, send email to testng...@googlegroups.com. To unsubscribe from this group, send email to
. For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
--
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 post to this group, send email to testng...@googlegroups.com.
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.