Optional Step object in UFT

OptionalStep is used to add optional statement in UFT script. In below example, first statement is optional. If UFT does not find the notepad window and editor, error will not be thrown. Next statement will be executed. If we do not use OptionalStep, error is thrown if the object is not found in first statement.
OptionalStep.Window("Notepad").WinEditor("Edit").Type "hello"
msgbox "hello"  

Web development and Automation testing

solutions delivered!!