tags:

views:

225

answers:

3

I'm trying to figure out what the syntax is to record the times it takes to run a test script in Selenium IDE. How do I record the start and end times in the script (using html)?

A: 

IIRC, it does do this already. In fact if any test runner does not record that, I would log a feature request :)

leppie
A: 

You'd probably have to execute some javascript statements.

storeEval | javascript{var startTime=new Date().getTime(); startTime;} | startingtime
setSpeed | 500
open | http://www.google.com/
setSpeed | 0
storeEval | javascript{var endTime=new Date().getTime(); endTime;} | endingtime
echo | ${startingtime}
echo | ${endingtime}

Edit code for elapsed time:

storeEval | javascript{startTime=new Date().getTime(); startTime;} | startingtime
setSpeed | 500
open | http://www.google.com/
setSpeed | 0
storeEval | javascript{endTime=new Date().getTime(); endTime;} | endingtime
storeEval | javascript{var duration = endTime - startTime;duration;} | dur
echo | ${startingtime}
echo | ${endingtime}
echo | ${dur}
s_hewitt
A: 

A very useful way of doing this using test automation is provided here. Substitute Groovy for any language you choose and the principle remains the same

j pimmel