Forum Discussion
EADS_Support
16 years agoOccasional Contributor
you can create a datasink that writes to an excel file
add a datasink property then write to that from the groovy script
i.e.
create a datasink called TestOutput
create properties within datasink called 'EmployeeName' & 'EmployeeID'
then in groovy script
def EMPLOYEENAME = context.expand( '${DataTest#EMPLOYEENAME}' )
def EMPID=context.expand('${DataTest#EMPID}')
log.info(EMPLOYEENAME)
log.info(EMPID)
def datasink = testRunner.testCase.testSteps('TestOutput')
datasink.setPropertyValue('EmployeeName', EMPLOYEENAME)
datasink.setPropertyValue('EmployeeID', EMPID)
or you can reference the data source directly within the datasink value field bypassing the need to do this within a groovy script, of course that does depend on whether or not you need to use those values in the script
just a thought
add a datasink property then write to that from the groovy script
i.e.
create a datasink called TestOutput
create properties within datasink called 'EmployeeName' & 'EmployeeID'
then in groovy script
def EMPLOYEENAME = context.expand( '${DataTest#EMPLOYEENAME}' )
def EMPID=context.expand('${DataTest#EMPID}')
log.info(EMPLOYEENAME)
log.info(EMPID)
def datasink = testRunner.testCase.testSteps('TestOutput')
datasink.setPropertyValue('EmployeeName', EMPLOYEENAME)
datasink.setPropertyValue('EmployeeID', EMPID)
or you can reference the data source directly within the datasink value field bypassing the need to do this within a groovy script, of course that does depend on whether or not you need to use those values in the script
just a thought
