Calculate time after image disappear

Hi,
Usually we are taking time between two images like if i click OK button then till I am waiting for cancel button.

Click "ok"
Put now into StartTime
waitfor 90, "TerminalAssignmentViewTime"
Put now into EndTime 
Put EndTime - StartTime into TotalTime

Now, I want to take time after image disappear .Suppose while clicking on ok(put start time) button one small window will appear for 1 min .when the small window getting to close(Put end time) then I would like to take time.

Please help me…


put now into startTime
repeat while imageFound("myImage")
end repeat
put now into endTime

Thanks… working :slight_smile:

Hi,
But end time is not correct . suppose after image disappear from screen still it is searching for image for 10-20 secs … then its calculating the time .
I want exact time after image disappear from screen.

Hello, you might try using code like this instead:

put now into startTime
repeat until not imageFound("myImage")
end repeat
put now into endTime

Another thing you can try is adjusting the image search count. By default, eggPlant searches the screen of the SUT 7 times before reporting an image search failure. So in this scenario you might want to set the global property for the image search count, setting it to 1 or something so that the search is more “life-or-death”, so to speak:

put the imageSearchCount into ISC -- store the default
set the imageSearchCount to 1 -- lower the count significantly
put now into startTime
repeat until not imageFound("myImage")
end repeat
put now into endTime
set the imageSearchCount to ISC -- restore the ISC to the default setting

You can read about the imageSearchCount and other global properties here: http://docs.testplant.com/?q=content/global-properties

Here I am using like below code


put now into startTime 
repeat until not imageFound("myImage") 
end repeat 
put now into endTime
Put StartTime-EndTime into TotalTime
put TotalTime- 20 into ExactTime
Log ExactTime

Because, after image disappear from SUT it will take 20 secs for calculate time.
Please correct me if it is correct or wrong.