REG: Actions in QTP
I am having two actions Action1 and Action 2 in same test. In Action1 i am Calling Action2 using RunAction Command.
Action1 is Executing the statments in Action2 first,again Action2 is also executing(2 times) here i dont want to execute the Action2 statements again
Please provide the solution to Execute Action1 only.
1- The following line should be added to Action1 (I guess this is already done):
Call RunAction("Action2", oneIteration)
2- In the LHS "Test Flow", Delete Action2 That is on the same level of Action1
I hope you might have some data in Global data table.
Configure the setting properly in Action 2. Goto Action Properties and choose "Run one iteration" only(check the right option)
Thanks for your comment. I have data in the Global sheet and Set the Action Properties on "Run One Iteration" only.
I am having framework driver script code in Action 1 and Some Reusable code in Action 2 with same Test.
I will call the Action 2 codes if needed using framework keywords now the Action 1 code call the Action 2 based on Keyword and execute the Action2.
After executing the entire script in Action 1 again QTP is Executing the Action 2 codes. Here i don't want to execute the Action2 Again.
Give some solution.
Solution1. For you the simple way to use ExitTest after first action if your framework return value don't want to run the second action again.
Solution2: if you have many actions like Action1 (call Action 2), Action 2, Action 3 , Action 4
Then modify your framework and value not to call Action2 (by changing the decision control- select etc)
Open the test folder(Your current test folder) find Action0 Folder then locate Script.mts file. Open the file with notepad and comment the [RunAction "Action2", oneIteration] using single quote ( ' ) like this [' RunAction "Action2", oneIteration]
Note: Close the test if it is opened in QTP before performing these actions