nagoorkj
6 years agoContributor
is there any option to read the total project execution time through groovy
is there any option to read the total project execution time taken through groovy
I tried to by creating two properites
Date startTime= new Date() Very first test case and ending of test...
- 6 years ago
first Testcases:
import groovy.time.* import java.text.SimpleDateFormat testRunner.testCase.testSuite.setPropertyValue('exeStarttime', new java.text.SimpleDateFormat("yyyy-MM-dd-HH:mm:ss").format(new Date()))
last testCases:
import groovy.time.* import java.text.SimpleDateFormat
Date exeEndtime = new Date();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH:mm:ss") Date exeStarttime = dateFormat.parse(testRunner.testCase.testSuite.getPropertyValue("exeStarttime")); TimeDuration duration=TimeCategory.minus(exeEndtime, exeStarttime); log.info durationOutput : 10.0000 seconds.
Hope it will help you.
- 6 years ago
I am happy to accept this answer.it is working fine, just i need to place it in tear down and set up scripts