Override Step info

20 views
Skip to first unread message

Renish K.R

unread,
Sep 15, 2024, 10:21:25 PM9/15/24
to qaf users
I would like to know how to override some step info before step execution. I have tried using Step Listener. I want to develop a solution similar to the inbuilt replacement of ${env.abc}

public void beforExecute(StepExecutionTracker stepExecutionTracker) {
 step.setDescription(stepExecutionTracker.getStep().getDescription().replaceAll("generate.passport_no", utils.generatePassport("USA"));
}
-- Throwing error

Note: The below implementation works for reports, not actual execution. The report is getting changed, but the execution is not getting replaced value.

stepExecutionTracker.getStep.getDescription((stepExecutionTracker.getStep().getDescription().replaceAll("generate.passport_no", utils.generatePassport("USA")).

cjayswal

unread,
Sep 15, 2024, 11:15:35 PM9/15/24
to qaf users
you should try using setDescription method. There can be better ways to achieve it without modifying step description.

1 work with step arguments instead of description
2 you can use expression as parameter in property value, for instance ${exp:fully.qulifiled.classname.generatePassport("USA")} refer documentation for property parameter-interpolation
Reply all
Reply to author
Forward
0 new messages