18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
Is exact duration of a test action available in sahi?
Hi,
consider sahi script fragment:
...
_setValue(_textarea("wysiwygcontent"), $request_name);
// here I need start a timer
_click(_submit("Save"));
// here I need stop a timer and output EXACT duration of '_click(_submit("Save"));' in test log
...
Can I measure exact time duration of a '_click(_submit("Save"));' action in the example above?
I suppose, I have to use Javascript's getDate ().getTime () method and have to calculate time difference in milliseconds.
But, as I refer to sahi's settings file, 'sahi.properties', I found a parameter in it:
#Time (in milliseconds) delay between steps
script.time_between_steps=200
so, will these 200 milliseconds be included in time difference obtained by Javascript's getDate ().getTime ()? or not?
or, general question,
can I measure exact time duration of an arbitrary test action (_click, _setSelected, etc.)? if corresponding DOM elements have event handlers, can I get their spent time too, in total duration? can I ommit any sahi's dalays between steps in the calculation?
consider sahi script fragment:
...
_setValue(_textarea("wysiwygcontent"), $request_name);
// here I need start a timer
_click(_submit("Save"));
// here I need stop a timer and output EXACT duration of '_click(_submit("Save"));' in test log
...
Can I measure exact time duration of a '_click(_submit("Save"));' action in the example above?
I suppose, I have to use Javascript's getDate ().getTime () method and have to calculate time difference in milliseconds.
But, as I refer to sahi's settings file, 'sahi.properties', I found a parameter in it:
#Time (in milliseconds) delay between steps
script.time_between_steps=200
so, will these 200 milliseconds be included in time difference obtained by Javascript's getDate ().getTime ()? or not?
or, general question,
can I measure exact time duration of an arbitrary test action (_click, _setSelected, etc.)? if corresponding DOM elements have event handlers, can I get their spent time too, in total duration? can I ommit any sahi's dalays between steps in the calculation?
Comments
For your purpose, you could wrap your _click inside another function, take the time diff, log it and then proceed.
Would that work for you?
Regards,
Narayan