Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Read next datatable rather than login again
#6
Solved: 10 Years, 10 Months, 1 Week ago
Hi Cocojava,
if I am getting it clearly, you want to login once and do the flight operation multiple times. let me know if I am incorrect.
for this you will need to create two reusable, one for login and one for flight operation, put the login code into the login reusable, you can pass the username and password either using data table or action parameter, then the flight operation part could be in another reusable and pass you data in the datatable, could be on multiple rows depending on your requirement. then you just need to iterate through all the rows of your this reusable only. coz if you iterate for a single reusable consisting both login and operation together, everytime QTP will login and do the same operations and corresponding login data will be required. same goes if you put data in your global sheet.
your login reusable could be something like
Code:
SystemUtil.Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe","","C:\Program Files\HP\QuickTest Professional\samples\flight\app\","open"
Dialog("Login").WinEdit("Agent Name:").Set Parameter("user")
Dialog("Login").WinEdit("Agent Name:").Type  micTab
Dialog("Login").WinEdit("Password:").Set Parameter("pwd")
Dialog("Login").WinEdit("Password:").Type  micReturn

flightoperation
Code:
f Window("Flight Reservation").Exist  Then

    Window("Flight Reservation").Activate
    Window("Flight Reservation").WinButton("Button").Click
    Window("Flight Reservation").ActiveX("MaskEdBox").Type DataTable("FlightDate", dtLocalSheet)
    Window("Flight Reservation").WinComboBox("Fly From:").Select DataTable("From", dtLocalSheet)
    Window("Flight Reservation").WinComboBox("Fly To:").Select DataTable("To", dtLocalSheet)
    Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinList("From").Select 1
    Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
    Window("Flight Reservation").WinEdit("Name:").Set DataTable("Name", dtLocalSheet)
    Window("Flight Reservation").WinButton("Insert Order").Click
End If
with the data in datatable something like
Code:
date   from   to name
102810    London    Los Angeles    x
102910    Denver    London    y
103010    Paris    Portland    z
your test will be look like somewhat as below
Code:
RunAction "Login [Login]", oneIteration, "name", "mercury"
RunAction "FlighOPeration [FlightOperation]", allIterations
note that nothing to put in global datasheet in this case
hope this will help you, let me know if you any difficulties.

Reply


Messages In This Thread
RE: Read next datatable rather than login again - by Saket - 10-27-2010, 01:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Want to read the data from excel and set read value in the JavaTable rajeevk7 0 2,180 07-10-2017, 04:20 PM
Last Post: rajeevk7
Exclamation Login & logout in Siebel and clicking pop-up button yuetling926 7 10,808 07-09-2014, 10:43 PM
Last Post: hhamilton
  Unable to Click on Login Button Paurav 1 3,179 07-03-2014, 05:27 AM
Last Post: supputuri
  for help.Run a test to login,and then it didn't jump to another page maosilu 0 2,599 11-01-2013, 01:27 PM
Last Post: maosilu
  Datatable add and datatable import sheet wheelercha 4 33,376 06-14-2012, 04:53 PM
Last Post: Arul

Forum Jump:


Users browsing this thread: 1 Guest(s)