Have been looking to solve this (test from my boss) for 2 days now.
I have a webpage that is all Javascript that we are trying to automate with a VBScript (yes it needs to be in VBScript)
This issue that I am running into is that the fields I need to populate of select from a combo box do not have ID's and the only unique element is the name. For another web page that I am automating I am using the .getElementsByID function. However when I try to use the .getElementsByName I receive WSH error "Object support this property or method:...."
What I am trying to do is select an item from the drop down in HTML Snip1 below and then hard code in a value to enter in the textbox for HTML Snip2 below.
Any help would be greatly appreciated.
VBScript
'Sub for Page Load Time Wait
Sub IEPageLoad(obj)
Do while IE.busy
WScript.Sleep 100
Loop
End Sub
set ie = WScript.CreateObject("InternetExplorer.Application")
ie.navigate("https://www.thisisthewebpage")
ie.visible = True
IEPageLoad(IE)
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.SendKeys "UserID"
WScript.Sleep 100
objShell.SendKeys "{TAB}"
WScript.Sleep 100
objShell.SendKeys "Password"
WScript.Sleep 100
objShell.SendKeys "{Enter}"
IEPageLoad(IE)
With ie.Document
.getElementsByName("searchBy").Select = "User ID"
End with
HTMLSnip1