0

I want to know the difference between following code:

Function foo()
  'Do something
  ExitAction(1)
  'Do something 2
  Exit Function
End Function

I wonder if the do Something code 2 would be executed or not and reason behind.

codeomnitrix
  • 4,179
  • 19
  • 66
  • 102

1 Answers1

2

QTP Action can consist of more than one Function and this Action can be called from test to use any of the function written in this Action.

Now about your code block

As you are exiting from the Action itself, you get exit from your function 'foo' as well.Then execution flow will return to test which called this Action.

Something 2 code block will not be executed.

Amol Chavan
  • 3,835
  • 1
  • 21
  • 32
  • ok great but don't qtp throws errors like Notreachable code or sth similar – codeomnitrix Dec 27 '12 at 05:56
  • @codeomnitrix Programmer (like you & me) are coding QTP to exit from Action, then why should we expect it to throw such message which is not error indeed? – Amol Chavan Dec 27 '12 at 06:15