ak0032803
15 years agoContributor
How to run data sink test step using groovy
Hi ,
I want to run data sink step using groovy scripts.
The test cases format looks like -
Data source
sendrequest
groovy script for datasink
datasink step
loop .
My data source has values like - Username , DomainName, SMTPDomainNamelist
e.g Admin@test.com,Test.com, ' SMTPDom1.com,SMTPDom2.com'
now in data sink step i want to store values in another excel as -
Username , DomainName, SMTPDomainName
i.e it should store like
Admin@test.com,Test.com, SMTPDom1.com
Admin@test.com,Test.com, SMTPDom2.com
I tried following script but its not storing the value.
Any idea how to achieve it ??
I want to run data sink step using groovy scripts.
The test cases format looks like -
Data source
sendrequest
groovy script for datasink
datasink step
loop .
My data source has values like - Username , DomainName, SMTPDomainNamelist
e.g Admin@test.com,Test.com, ' SMTPDom1.com,SMTPDom2.com'
now in data sink step i want to store values in another excel as -
Username , DomainName, SMTPDomainName
i.e it should store like
Admin@test.com,Test.com, SMTPDom1.com
Admin@test.com,Test.com, SMTPDom2.com
I tried following script but its not storing the value.
Any idea how to achieve it ??
def parentOrgnization_UserName = context.expand( '${Add SMTP Domain_CustomerDataSource_Valid#ParentOrgnization_UserName}' )
def customerDomain = context.expand( '${Add SMTP Domain_CustomerDataSource_Valid#CustomerDomain}' )
def sMTPDomainList = context.expand( '${Add SMTP Domain_CustomerDataSource_Valid#SMTPDomainList}' )
def dataSink = testRunner.testCase.testSteps['InsertDataToDeleteDomain'];
for(key in sMTPDomainList.split(","))
{
dataSink.setPropertyValue('parentOrgnization_UserName', parentOrgnization_UserName);
dataSink.setPropertyValue('customerDomain',customerDomain)
dataSink.setPropertyValue('SMTPDomainName', key)
testRunner.runTestStepByName('InsertDataToDeleteDomain')
}