I need to set the first input box to User ID, second input box to Is, and the third input box to user12345. I am attempting to use getElementsByClassName for the first time. I have been able to access the other elements by getElementById but since these ones don't have an ID, I'm at a loss. Below is what I have tried. So what is the trick to accessing these web elements?
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;Create an Internet Explor instance.
wb := ComObjCreate("{D5E8041D-920F-45e9-B8FB-B1DEB82C6E5E}") ; create a InternetExplorer Medium instance
wb.Visible := True
wb.Navigate("https://zzzmyWebPage/Users")
While wb.busy ; wait for the page to load
Sleep, 2000
wb.document.getElementById("search").value := "testing" ;works
wb.document.getElementByID("toggleAdvancedSearch").click() ;works
wb.document.getElementsByClassName("advancedSearchField")(0).value = "UserID"
wb.document.getElementsByClassName("advancedSearchOperator")(0).value = "Is"
wb.document.getElementsByClassName("advancedSearchOperand")(0).value = "user12345"
Sleep, 5000
msgbox Done!
Sleep, 10000
wb.quit()
return