Forum Discussion
deepesh_jain
14 years agoFrequent Contributor
Agreed, but the assertion would be on a test step itself.
If you are using thsi code AFTER the soap/rest step, and the code do work in script assertion, why not pass all the details of the test step in context from the script assertion and see if you are able to access it later in groovy script, its kinda redundant, but if it works why not.
Try:
context.step_name = context.getCurrentStep().getAssertionByName('Response')
OR
context.step_name = context.getCurrentStep()
from script assertion
Then in the groovy later on, access it as:
def abc = context.step_name
def xyz = abc.getAssertionByName('Response').selectFromCurrent();
If you are using thsi code AFTER the soap/rest step, and the code do work in script assertion, why not pass all the details of the test step in context from the script assertion and see if you are able to access it later in groovy script, its kinda redundant, but if it works why not.
Try:
context.step_name = context.getCurrentStep().getAssertionByName('Response')
OR
context.step_name = context.getCurrentStep()
from script assertion
Then in the groovy later on, access it as:
def abc = context.step_name
def xyz = abc.getAssertionByName('Response').selectFromCurrent();