Functions

VB Script Function for returning multiple values
'Write a function to verify the state(enabled / disabled) of Update Order Button in Flight Reservation Window
 
'(Condition1: Before open an Order "Update Order" Button should be Disabled)
 
'(Condition2: After Open an Order "Update Order" Button should be Enabled)
'----------------------------------------------------------------------------------------
Function UpdateButton_State()
Window("Flight Reservation").Activate

Before_Open=Window("Flight Reservation").WinButton("Update Order").GetROProperty("enabled")

If  Before_Open= False Then
    Verify1= "Update Order Button Disabled"
    Else
    Verify1= "Update Order Button Enabled"
End If

Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set "1"
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
Window("Flight Reservation").WinButton("Update Order").Click

After_Open=Window("Flight Reservation").WinButton("Update Order").GetROProperty("enabled")

    If  After_Open = True Then
    Verify2= "Update Order Button Enabled"
    Else
    Verify2= "Update Order Button Disabled"
End If
UpdateButton_State=Array (Verify1, Verify2)

End Function
 ------------------------------------------------------
Result=UpdateButton_State()
Msgbox Result(0)
Msgbox Result(1)

0 comments:

Post a Comment