i cant get current date

I am creating an automatic test for some webs and I’m using WebDriver, TestNG and code that is written in Java. Every output from the console should display time, when a step is performed. A week ago everything was OK, every step had a different time set. However, now the time stays still the same.

09:50:48: ***********start***********
09:50:48: ***********PART 1***********
09:50:48: 1.1 home: OK xxxx
09:50:48: ***********PART 2***********
09:50:48: 2.1 home: OK xxxx
09:50:48: 2.2 home: OK xxxx
09:50:48: 2.3 home: OK URL xxxx
09:50:48: 2.4 home: OK xxxx
09:50:48: ***********PART 3***********

I have used this code:

Date dNow = new Date( );
SimpleDateFormat ft = new SimpleDateFormat ("yyyy-MM-dd hh:mm:ss");

System.out.println(ft.format(dNow) + ":" + " xxxx");

Can someone tell me, how can I get again the current time for every step?

Source: eclipse

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.