Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with wait property.
#1
Solved: 11 Years, 4 Months, 4 Weeks ago
HI,

I am using the following code to see the difference between wait and waitporperty, however there seems to be no difference, please help me

Code:
Window("Flight Reservation").ActiveX("MaskEdBox").Type "032810"
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("From").Select "12117   FRA   09:48 AM   LON   10:31 AM   LH     $105.00"
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "Rahul Test"
Window("Flight Reservation").WinButton("Insert Order").Click
'wait(10)
If Window("Flight Reservation").WinButton("Button").WaitProperty("enabled","true",20000) Then
    Window("Flight Reservation").WinButton("Button").Click
End If

I am using the windows application provided by mercury for running this test.


THanks,
RAhul.
Reply
#2
Solved: 11 Years, 4 Months, 4 Weeks ago
Waitproperty is the synchronized point, used to pause the script until the required object achives the value you specify.
You should not use this in IF..Then.
use it like -
Code:
Window("Flight Reservation").WinButton("Button").WaitProperty "enabled","true"
Window("Flight Reservation").WinButton("Button").Click

Reply
#3
Solved: 11 Years, 4 Months, 4 Weeks ago
Two things.

1) we can use it with If.. Then( at least i think so.
2) Even without If.. Then it is not working.
I have also given the default timeout . Still it does not seem to be working. It is however working fine with wait(10) property. It sounds funny i dont think i have done wnything wrong. You guys can try it locally and see if this is working or if i am going wrong some where.

Thanks-
Rahul.
I have just found the answer to this.

The reason why this was not working is that the enable property for button is always true. When i used the wait property method with the windows object as below it worked.

Window("Flight Reservation").WaitProperty "enabled","true",20000

Thanks,
Rahul
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  help with wait property function kp_usa 3 4,347 12-20-2012, 10:49 PM
Last Post: kp_usa
  wait QAVA 1 3,062 11-13-2012, 07:29 PM
Last Post: imzeeshan
  How to control WAIT time with STATIC variable? chong67 3 4,059 06-22-2012, 10:38 AM
Last Post: sshukla12
Exclamation Alternative for Wait Statement Veekay 2 8,619 03-20-2012, 07:13 PM
Last Post: swathi
  Verifying the value exists and if not, wait up to 5min HeZma 3 4,147 02-25-2012, 12:21 PM
Last Post: rajpes

Forum Jump:


Users browsing this thread: 1 Guest(s)