Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to call Action
#1
Solved: 11 Years, 4 Months ago
Hi Friends,
I have created two action.
1 Login
2 Insert Flight order.
In first action I an parameterizing Login
In second action i am parameterizing Fly From dates.
But before going for second login, it should run all Fly from dates.

For this i am inserting below line after last line of second action.
RunAction Insert Flight order, AllIteration
but insted of getting different dates from datatable,it is accepting first date and the the code is executing continusly.

My aim is i want to first login with any user, insert the order for different Fly dates and run this whole test for different login user.

Hope you guys help me

Thnks in advance
Reply
#2
Solved: 11 Years, 4 Months ago
Hi ,

Find the following way :

Step 1 :
Create 3 Actions
1)Login ---> 3 rows of data in global sheet of datatable(3 userNames & pwds)
2)Insert_FlightOrder --> 3 rows of data in Localsheet of Datatable ( 3 different filght dates )
3)Exit

Step2 :
Go to Keyword View -> Select "Insert_FlightOrder" Action --> Right Click "Action Call Properties" --> Choose "Run on All rows"

Step3 :
Now execute the script & see .... it will work as expected Smile

_________________________________________________________________________________________________________
FYI...Find the entire code for your requirement given below :

Code for "Login" Action :

Code:
invokeapplication  "D:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe"
dialog("Login").WinEdit("Agent Name:").Set DataTable("Uname", dtGlobalSheet)
dialog("Login").WinEdit("Password:").Set DataTable("Pwd", dtGlobalSheet)
dialog("Login").WinButton("OK").Click

Code for "Insert_FlightOrder" Action :

Code:
Window("Flight Reservation").WinMenu("Menu").Select "File;New Order"
Window("Flight Reservation").WinObject("Date of Flight:").Type DataTable("Fight_Date", dtLocalSheet)
Window("Flight Reservation").WinComboBox("Fly From:").Select "Frankfurt"
Window("Flight Reservation").WinComboBox("Fly To:").Select "Los Angeles"
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinList("From").Select 0
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "sree"
Window("Flight Reservation").WinRadioButton("First").Set
Window("Flight Reservation").WinEdit("Tickets:").Set "2"
Window("Flight Reservation").WinButton("Insert Order").Click
wait(5)

Code for "Exit" Action :

Code:
Window("Flight Reservation").WinMenu("Menu").Select "File;Exit"
Reply
#3
Solved: 11 Years, 4 Months ago
Hi sreekanth ,

thanks a lot . Finally i done it.
But just a one point i have to add for step 2

I am not able to Right Click "Action Call Properties" from keyword view as you told.
As i am using QTP 9.5
I found the path as

Go To the Test Flow >> select the Action >> Right click "Action Call Properties".>> Choose "Run on All rows"


thanks a lot again.
Reply
#4
Solved: 11 Years, 4 Months ago Exclamation 
Hi This really worked and was explained really well. I would like to know if in Action2, the data varies dynamically i.e., for every login from Action1, if data in Action 2 varies for each login users; how to do that. I mean in Point2 of step1.

Step 1 :
Create 3 Actions
1)Login ---> 3 rows of data in global sheet of datatable(3 userNames & pwds)
2)Insert_FlightOrder --> 3 rows (Data varies dynamically i.e., different login has different number of rows) of data in Localsheet of Datatable ( 3 different filght dates )
3)Exit
Reply
#5
Solved: 11 Years, 4 Months ago
Hi Everyone,

Can you please explain me how can I create new action?

Thanks
Ashita
Reply
#6
Solved: 11 Years, 4 Months ago
Hi Ashita,

To create new action: Goto "Insert" Menu and then click on "Call to New Action" i.e., Menu: Insert--> Call to New Action

Regards,
- Forest Gump
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Object not found during the 2nd iteration of an Action call in a For loop BGunay 0 973 04-23-2020, 07:08 PM
Last Post: BGunay
  Is it possible to call Java window and Power Builder Window in 1 Action sbkhbk 0 2,541 06-05-2014, 08:18 PM
Last Post: sbkhbk
  insert call to new action bistritapcv 1 2,597 04-06-2013, 12:09 PM
Last Post: ravi.gajul
  How to stop Second Action Call faheem05 6 4,145 10-05-2012, 11:11 AM
Last Post: faheem05
Exclamation QC is very slow and does not run my tc. My testcase has 'call to existing action' chong67 0 2,164 06-13-2012, 07:47 PM
Last Post: chong67

Forum Jump:


Users browsing this thread: 2 Guest(s)