Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calling an action in the same script in QTP
#8
Solved: 11 Years, 4 Months, 4 Weeks ago
Hi Galstar,

Creating & Accessing Environment Variable programmatically would solve your problem Smile

Refer the below example for more info.

For example, there is Test by name "MyTest" which contain 3 Actions i.e Action1,Action2,Action3.

Here I am calling Action2,Action3 in Action1 and once Action1 is executed Action2,Action3 will not get executed again.

Action1 Code:

Code:
Environment.Value("Execute")="Yes"
  
      Msgbox "This is Action1 code"
      RunAction "Action2",OneIteration
      RunAction "Action3", oneIteration

  Environment.Value("Execute")="No"
Action2 Code:

Code:
If Environment.Value("Execute")="No" then
       ExitAction
    End if

    Msgbox "This is Action2 code"

Action3 Code:

Code:
If Environment.Value("Execute")="No" then
       ExitAction
    End if
    
    Msgbox "This is Action3 code"
Reply


Messages In This Thread
RE: Calling an action in the same script in QTP - by sreekanth chilam - 08-26-2010, 11:10 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Calling a function in a Test Script from a function library anupam4j 3 6,180 06-26-2015, 12:31 AM
Last Post: babu123
  Calling a HP Service Test Skript Gandalf2005 0 2,155 09-05-2012, 07:53 PM
Last Post: Gandalf2005
  how to access Local dataTables in another action within a same script RA185112 5 6,086 07-25-2012, 01:27 PM
Last Post: sshukla12
  Calling of function hamzaz 5 4,624 07-25-2012, 12:44 PM
Last Post: Shridevi.Salagare
  Function Calling after executing some steps TaranVohra 2 3,024 06-05-2012, 10:06 AM
Last Post: TaranVohra

Forum Jump:


Users browsing this thread: 2 Guest(s)