Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can you do functions by calling filename or any other better ways?
#3
Not Solved
I got it working the first time. It was not that hard. I just google it. I just didnt know its called 'function library'

You need to go to Resources Tab and do "Associated Function Librarys".

I dont know if this is good programming or not.

I am still learning.

=============
' I save this to a file

Code:
Dim  RndValue
Randomize
RndValue = Int(  (300-200 +1)* Rnd + 200)

Public Function OutDate()
     OD = DateAdd("d", RndValue, Date)
     OutDate = OD
End Function

Public Function ReturnDate()
    RD= DateAdd("d", RndValue+10, Date)
    ReturnDate = RD
End Function

======================
'Put this in expert view:

Code:
Browser("Delta Air Lines - Airline_2").Page("Delta - Book a flight").WebEdit("departureDate[0]").Set OutDate
Browser("Delta Air Lines - Airline_2").Page("Delta - Book a flight_14").WebEdit("departureDate[1]").Set ReturnDate
Reply


Messages In This Thread
RE: Can you do functions by calling filename or any other better ways? - by chong67 - 05-29-2012, 11:41 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Perform some functions whenever QTP Stop button is pressed smartkarthi 2 3,261 08-22-2013, 11:43 AM
Last Post: smartkarthi
  exit parent functions as well Shridevi.Salagare 3 3,917 07-31-2013, 12:15 AM
Last Post: Ankur
  Datatable in functions shwetasharma 2 3,559 03-26-2013, 08:00 AM
Last Post: sams001
  Problem with using two functions in the same action mhanaan 2 3,060 09-14-2012, 10:09 PM
Last Post: mhanaan
  Calling a HP Service Test Skript Gandalf2005 0 2,155 09-05-2012, 07:53 PM
Last Post: Gandalf2005

Forum Jump:


Users browsing this thread: 1 Guest(s)