Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to call testscript after executing previous one.
#1
Solved: 10 Years, 9 Months ago
Hello All,

I want to call existing testscript after completion of one of my other testscript, how would i call testscript within testscript, please let me know hoping for your cooperation.

Thanks
Mahesh
Reply
#2
Solved: 10 Years, 9 Months ago
Convert the exiting script as a reusable action and call that action into other test script.
To create reusable action:
1. Open the existing script by using qtp.
2. Goto ToolBar>Edit>Action>Action Properties.
3. In the action properties window Check the check box Reusable action and in the name text field>Enter your desire action name.
4. Save your test.

Now open the new test:
1. Goto ToolBar>Insert>Copy of action/call to existing action [Note: Call to existing action you cann't edit the action]
2. In the selection action window>Selet the Path of the located action.
3. Make Sure you have always check the "After the Current step".
4. Click on the ok button

Check the code EG: RunAction "Copy of Action1", oneIteration [This is copy of action]
so if you choose call to exit action the code is Eg:RunAction "Action1 [PrinterFromControlPanel]", oneIteration


Thanks,
Sylu
And also insted of action you can create the functions and use them.
Reply
#3
Solved: 10 Years, 9 Months ago
Hi Sylu,

Thanks for your response, i achieve what i want, thanks once again.

Mahesh
Reply
#4
Solved: 10 Years, 9 Months ago
Hello All,

I want to execute Testscript with For Statment, and i would that two Iteration.in the Run time Session the Testscript is only one Iteration and the Run Session in line waiting.


Code:
Window("Program Manager").WinListView("SysListView32").Activate "Flight GUI"
Dialog("Login").WinEdit("Agent Name:").Set "wissal"
Dialog("Login").WinEdit("Password:").SetSecure "535ce73a0f413bf2ade883f1739e8d594d53d2f6"
Dialog("Login").WinButton("OK").Click
For i = 1 To 2 Step 1
Code:
Window("Flight Reservation").WaitProperty "enabled", 1, 10000
Window("Flight Reservation").WinObject("Date of Flight:").Click 2,11
Window("Flight Reservation").WinObject("Date of Flight:").Type "121214"
Window("Flight Reservation").WinComboBox("Fly From:").Select "Frankfurt"
Window("Flight Reservation").WinComboBox("Fly To:").Select "London"
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinList("WinList").Select "13544   FRA   12:48 PM   LON   01:33 PM   SR     $168.50"
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Tickets:").Set "Wissal"
Window("Flight Reservation").WinRadioButton("Business").Set

Window("Flight Reservation").WinButton("Insert Order").Click
16-
Code:
Window("Flight Reservation").WinButton("Update Order").WaitProperty "enabled", 1, 10000
Window("Flight Reservation").WinButton("Update Order").Click
Window("Flight Reservation").WinEdit("Edit").Output CheckPoint("Edit_2")
Next
Code:
Window("Flight Reservation").WinMenu("Menu").Select "File;Exit"
thank you for your Help
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  error when executing an UFT automation script alexalloza 0 1,394 10-30-2018, 06:17 PM
Last Post: alexalloza
  Executing via create "RES"xx folder? nishitd 0 1,112 03-07-2018, 01:09 AM
Last Post: nishitd
  QTP-Re-executing script after completion of all iterations JwalantBhatt0602 1 2,551 03-24-2016, 12:37 AM
Last Post: JwalantBhatt0602
  QTP is getting closed after executing first test in MTM(Batch) Shyama 0 2,036 10-07-2014, 07:26 PM
Last Post: Shyama
  Testscript Wigi 2 2,436 05-23-2014, 03:39 PM
Last Post: excellentpawan123

Forum Jump:


Users browsing this thread: 1 Guest(s)