As the name suggests the "Optional step" doesn't needs to be necessarily executed during run session. A step when declared optional is not mandatory to be executed. If the corresponding GUI object is present, QTP performs the operation on it. If the GUI object is not present, QTP bypasses the optional step and proceeds to execute the next step.
To set a step as optional in keyword view right click on the step and select Optional Step.
Alternatively, you can directly write the keyword "OptionalStep" preceding a statement to make it optional
To set a step as optional in keyword view right click on the step and select Optional Step.
Alternatively, you can directly write the keyword "OptionalStep" preceding a statement to make it optional