INTERVIEW QUESTIONS
TESTING
QTP
DETAILS
Question: Can we call QTP test from another test using scripting.
Suppose there are 4 tests and i want to call these tests in a main script. Is this possible in QTP?
Answer: Yes, we can call Any numbers of Test Scripts from Main Script.
For this, whatever scripts you want to call, you need to make The Actions in those scripts are Re-Usable actions. And then you can give a call to these scripts.
|
Question:
Can we call QTP test from another test using scripting.
Suppose there are 4 tests and i want to call these tests in a main script. Is this possible in QTP?
Answer:
Yes, we can call Any numbers of Test Scripts from Main Script.
For this, whatever scripts you want to call, you need to make The Actions in those scripts are Re-Usable actions. And then you can give a call to these scripts. Source: CoolInterview.com
1. Insert > Call to Existing Action 2. Select the "Test From" (If "Action" is being called from another Test) 3. Select the "Action" you want to call 4. Then select the Location, where the "Action" needs to be called in the current script 5. Click "OK"
Or you direct write the script as below in the line where you want to call the action:
"RunAction <ActionName>, (Iteration)"
Here, "<ActionName>" is the Action you want to call and the "(Iteration)" is optional where you can define number of iterations you want to execute.
Eg: 1. RunAction Action2, OneIteration (For single Iteration) 2. RunAction Action3, AllIterations (For All Iterations) 3. RunAction Action4, 1-3 (For iterations from 1 to 3)
Note: To Call an "Action" multiple times or to Call an "Action" from Other Tests, make sure the "Action" is marked as a "Reusable Action".
Source: CoolInterview.com
Answered by: Rajan Bansod | Date: 4/20/2010
| Contact Rajan Bansod
You can use Call() command in the main script while scripting and can call any number of tests in the main script. Syntax- Call FunctionName() Source: CoolInterview.com
Answered by: Pia | Date: 7/20/2010
| Contact Pia
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|