Forum Discussion
What happens when you like below,
SearchBar.Keys("^a") SearchBar.Keys("[BS]") Log.Message("Menu Number = " &strMenuNumber) SearchBar.Keys(strMenuNumber) SearchBar.Keys([Enter])
Hi Shankar,
It periodically gives the message "Window was destroyed during method execution." Your method for getting around the Del key is creative but I really don't need that step as I switch to using set_Text for the menu name. It still would get destroyed on the SearchBar.keys("[Enter]") in either case. I did notice that this time it said that the window was destroyed instead of the object. I have been getting both of those messages.
I have a workaround that seems to work but it's not very pretty and I don't think it really needs to be this complicated. My main concern is that .keys for del or Enter seems to be unstable.
For i = 1 to 4
' 'Log.Enable = False
bolStillExists = SearchBar.Exists
' 'Log.Enable = True
If Not bolStillExists Then
Log.Warning("SearchBar object was destroyed. Finding it again.")
Set SearchBar = QADNetUI.FindChild("ClrClassName", "UltraTextEditor", 20)
End If
Select Case (i)
Case 1:
SearchBar.SelectAll()
Case 2:
SearchBar.keys("[Del]")
delay 2000
Log.Message("Menu Number = " &strMenuNumber)
Case 3:
SearchBar.set_Text(strMenuNumber)
delay 2000
Case 4:
SearchBar.set_Text(strMenuNumber)
delay 2000
SearchBar.keys("[Enter]")
End Select
Next
Thanks for taking the time to help.
Tony Biegen