What is Optional Step and when to use in QTP ?
Tags:
Question ID: 105817
0
0
Marked as spam
Posted by (Questions: 17, Answers: 7)
Asked on January 16, 2015 8:58 am
206 views
Answers (1)
1
Private answer

An optional step instructs QTP to treat a particular step as optional and to not fail if it can't execute.

Let's say that during recording, you had a pop up window that appeared and you recorded clicking the close button. Now you have a step in your script that will try to click the close button on that pop up window, but what happens if it doesn't appear the next run? QTP will fail and give you an error saying that it can't find the close button object (or the parent window) and will fail the test results. If you make this step optional, QTP will wait the default timeout for the object to appear. If it doesn't it won't error. It will mark a note (non-failure) in the test results that it is skipping the optional step and will continue test execution.

In the keyword view, simply right-click the step you want and select Optional Step from the pop up menu. It will designate the step as optional by placing a question mark icon next to it.

Marked as spam
Posted by (Questions: 2, Answers: 477)
Answered on April 1, 2015 2:23 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top