If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

javascript stopwatch for actual test duration

05-29-2007, 05:13 PM

This one is not quite polished yet and a lot more complicated, but it gets the job done... I've written a little javascript 'stopwatch' that will automatically fill in the actual test duration. All you have to do is hit the start button at the beginning of executing the test, and hit the stop button when you're done, and it will fill in the time between button pushes into the actual test duration field. here's the code:

three global variables (outside the scope of any functions, at the top of the <script> section of the template):

I'm hoping to figure out why an actual stopwatch won't work here. I tried using someone else's stopwatch code, but I couldn't get it to actually count, so instead it just displays the start time in the clock field.

Comment

I'm guessing this displays the timer buttons in the web-based version, not the client version? Regardless, PassMark should pay you for coming up with these cool hacks!

Currently, I use TaskBlaze to track how long I spend on various tasks, including individual test cases. Bonus: it integrates with Outlook and can automatically record time spent on tasks in your calendar.

Requires the .NET framework.

Comment

yeah, any javascript i've been posting is all for the web-based app... for our use case, all our testers are using the web app, and only the admin's are using the standalone software. We do this so that we (the admin's) have more control over what goes into the test cases, and how they are updated, instead of just letting everyone be able to edit all the test cases without any trackability of the changes. I've been trying to make the job of our testers easier by hacking together some javascript (which i only can do because it's so similar to java/c#/c++, in which i have a little more experience, and we use c# in our company).

I figured if it helped us, it might help somone else, so why not share with the testlog community?