How to abort a test and succeeding actions in UFT?

  • Questions
  • How to abort a test and succeeding actions in UFT?
Question ID: 105694

I have a test that requires that a configuration item be present. I can query our database and check that the option is present or not. When the configuration item is not present, my UFT script goes to a Debug dialog error. I can put an if statement before the statement in error and avoid executing the line that will bomb into the debugger. However, then a later statement gets an error. The test is comprised of multiple actions and every action from here on requires the configuration option be present. Is there a command in script that I can use to gracefully abort the test so that succeeding actions in the Test don’t also run?

Marked as spam
Posted by (Questions: 359, Answers: 26)
Asked on October 30, 2014 5:52 pm
Answers (1)
Private answer

You have a few options, but it looks like what you're looking for is the ExitTest utility statement (since you don't want any execution to continue, based on your description...otherwise, you could use ExitAction).

UFT Help > Object Model Reference for GUI Testing > Utility Objects > Utility Statements

- ExitAction
- ExitActionIteration
- ExitTest
- ExitTestIteration

Marked as spam
Posted by (Questions: 0, Answers: 707)
Answered on October 30, 2014 5:54 pm
You are correct, sir! ExitTest is exactly what I needed.
( at October 30, 2014 5:55 pm)