//Check which state of page is displayed - A or B ?
//Use the the stepname accordingly
//During first run of the each state a baseline will be created and later it will be compared against baseline
if(element != null)
postRequest("Step 1" + "Form A", uid, scrBase64);
postRequest("Step 1" + "Form B", uid, scrBase64);
In the above sample you check for the required condition and create the StepName at runtime. The above approach can also be implemented at test level by simply regenerating the TestName at runtime.