sony_ratnakar
12 years agoNew Contributor
Access ListBox control
Hi am trying to access a listbox control of a desktop application on server using the following the script. Using 'Finchild' method the listbox control is recognized, but am unable to access using 'window' method. Any suggestions?
Sub Main
'Launch CATS UI application
LaunchOAG
delay(25000)
'Select the state "02-Arizona" from list of states in Login window
Dim Login,ListBox
Set Login = Sys.Process("OilAndGasUI").FindChild("WndCaption", "Login", 2)
If Login.Exists Then
ListBox = Login.Window("WindowsForms10.LISTBOX.app.0.3e799b","",1)
Listbox.ClickItem(4)
Else
Log.Error "The window ""Login"" was not found."
End If
end sub
Sub LaunchOAG
Dim WshShell, path
path = "D:\OilandGas\GUI_bin\OilAndGasUI"
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run(path)
end sub
Sub Main
'Launch CATS UI application
LaunchOAG
delay(25000)
'Select the state "02-Arizona" from list of states in Login window
Dim Login,ListBox
Set Login = Sys.Process("OilAndGasUI").FindChild("WndCaption", "Login", 2)
If Login.Exists Then
ListBox = Login.Window("WindowsForms10.LISTBOX.app.0.3e799b","",1)
Listbox.ClickItem(4)
Else
Log.Error "The window ""Login"" was not found."
End If
end sub
Sub LaunchOAG
Dim WshShell, path
path = "D:\OilandGas\GUI_bin\OilAndGasUI"
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run(path)
end sub