Ask a Question

How can we reference the groovy step in a testcase from assertion?.

SOLVED
ilovechiku
Contributor

How can we reference the groovy step in a testcase from assertion?.

I want to use the queries written in groovy step (star step) in my scripted assertions. How can i achieve this?.

my assertions are added not as a groovy step.

1 ACCEPTED SOLUTION

Accepted Solutions
nmrao
Community Hero

Re: How can we reference the groovy step in a testcase from assertion?.

Please use below statement for the same:
context.testCase.getPropertyValue('CompanyID1') to get the value of CompanyID1 of test case property.


Regards,
Rao.

View solution in original post

3 REPLIES 3
nmrao
Community Hero

Re: How can we reference the groovy step in a testcase from assertion?.

Can you elaborate your use case?


Regards,
Rao.
ilovechiku
Contributor

Re: How can we reference the groovy step in a testcase from assertion?.

i have a groovy step called GetEditableRole (starStep that you add as a test step)

in this i have 

testRunner.testCase.setPropertyValue("CompanyID1", menuDetailReturn.co)

also am able to print it ... both get and get are working fine.

log.info testRunner.testCase.getPropertyValue("CompanyID1")

 

Now i want to use this property in my assertion.

 

def starProperty = context.expand( '${GetEditableRole #CompanyID1}' )
log.info starProperty 

 

i dont get the company value on printing starProperty. Why?

 

 

nmrao
Community Hero

Re: How can we reference the groovy step in a testcase from assertion?.

Please use below statement for the same:
context.testCase.getPropertyValue('CompanyID1') to get the value of CompanyID1 of test case property.


Regards,
Rao.

View solution in original post

cancel
Showing results for 
Search instead for 
Did you mean: