I am trying to enter a value in a website filter, I can enter the username and password in login page by using the HTML element ID, after login I want to enter a value in filter input, the filter input id is units-grid-search-filter, but it automatically changed to units -grid -search -filter,
I don't the problem is in wherein element id space or delay
this is my code.
Sub Button3_Click()
On Error GoTo Err_Clear
sURL = "http://103.215.211.2/Web/Account/Login?ReturnUrl=%2fWeb%2f#25/-3/"
Set oBrowser = New InternetExplorer
oBrowser.Silent = True
oBrowser.timeout = 60
oBrowser.Navigate sURL
oBrowser.Visible = True
Do
' Wait till the Browser is loaded
Loop Until oBrowser.readyState = READYSTATE_COMPLETE
Set HTMLdoc = oBrowser.Document
HTMLdoc.all.UserName.Value = "abc"
HTMLdoc.all.Password.Value = "abc123"
HTMLdoc.all.units -grid - Search - Filter.Value = "123"
For Each oHTML_Element In HTMLdoc.getElementsByTagName("input")
Debug.Print oHTML_Element.Name
Next
Set frm = HTMLdoc.forms(0)
frm.submit
Set IE = CreateObject("InternetExplorer.Application")
' oBrowser.Refresh ' Refresh If Needed
Do Until Not IE.Busy And IE.readyState = 4
DoEvents
Loop
e.Click
Err_Clear:
If Err <> 0 Then
Err.Clear
Resume Next
End If
End Sub