I am unable to attach the attachement
please find the code the here
Hi Tanya,
I tried the below script (both VBscript and Jscript versions) and it failed at line number 24
(itemCount = items.Count) . It looks like it's not recognising items, then I changed line number 11 to Set w = Aliases.Application.frmMDI.MdiClient.frmDesktop.MainMenu1.
Items (added . items). Then I was able to see the items.count as 8 in the watch list. But it failed at the line number 37 (currentItem = items.Items(itemId)). It looks like it is not recognising items.items.
The screen shot of my .Net application is also attached.
Sub Test1
Dim ascend
Dim mdiClient
Dim frmQuery
Dim toolStrip
Dim w
Dim result
Set app = Aliases.application
Set mdiClient = app.frmMDI.MdiClient
Call aqObject.CheckProperty(Aliases.application.frmMDI.MdiClient.frmDesktop.MainMenu1, "Enabled", cmpEqual, True)
Set w = Aliases.Application.frmMDI.MdiClient.frmDesktop.MainMenu1
Set result = ClickItem (w, "Tools|Advanced Database connections|Sql Query", 0)
Set frmQuery = mdiClient.frmQuery
Call frmQuery.splitContainer.SplitterPanel.txtQuery.Keys("![ReleaseLast]delete customers")
Set toolStrip = frmQuery.Toolbar1
Call toolStrip.ClickItemXY("Execute (F8)", 36, 20)
Call toolStrip.ClickItemXY("&Back", 21, 20)
End Sub
Function ClickItem (items, itemStr, level)
tempResult = False
Dim itemArray, currentItem, itemCount
itemArray = Split(itemStr, "|", -1, 1)
itemCount = items.Count
For itemId = 0 to 9
currentItem = items.Items(itemId)
If SameText(currentItem.Caption, itemArray(level)) Then
Log.LockEvents()
items.Select("[" + itemId + "]")
Log.UnlockEvents()
Delay(500)
items.Click("[" + itemId + "]")
tempResult = true
else if (level < itemArray.length - 1) Then
tempResult = ClickItem(currentItem.SubMenu, itemStr, level + 1)
return tempResult
End If
End If
return tempResult
Next
End function