Micro Focus QTP (UFT) Forums
Problem with wait property. - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Problem with wait property. (/Thread-Problem-with-wait-property)



Problem with wait property. - tester_rahul - 03-26-2010

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.


RE: Problem with wait property. - Saket - 03-27-2010

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



RE: Problem with wait property. - tester_rahul - 03-29-2010

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