I am trying to loop through the options or items of a drop down menu, but I don't know the number of items as it will be changeable every time.
Here's the html part of the sList3
<select name="ctl00$ContentPlaceHolder1$Dschool" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$Dschool\',\'\')', 0)" id="ContentPlaceHolder1_Dschool" style="font-size:12pt;font-weight:bold;width:500px;">
<option selected="selected" value="0"> Select From Menu </option>
<option value="311223">first option</option>
<option value="311625">some option</option>
</select>
Here's my code that I have started
For i = 1 To 4
Set sList1 = .FindElementById("ContentPlaceHolder1_Dedara").AsSelect
sList1.SelectByIndex i
.Wait 2000
Set sList2 = .FindElementById("ContentPlaceHolder1_Drel").AsSelect
sList2.SelectByIndex 1
.Wait 2000
Set sList3 = .FindElementById("ContentPlaceHolder1_Dschool").AsSelect
'How can I loop through the options (unknown in length)
Next i
I would like to loop each option and debug.print the value of the option.
SOLUTION
With the help of JeffC this is the final solution
For j = 1 To sList3.Options.Count
Debug.Print sList3.Options(j).Text
Next j

for eachthrough thesList3.children()or something to that effect? That's how it works with anHtmlDocumentiircFor Each e In sList3.Children()but didn't work and I got an error.Optionslist hanging off the.AsSelect? If nothing else, you could count the number ofOPTIONs that are children of theSELECT.new SelectElement(driver.FindElement(...)).Optionswhich is a list of elements. You can slap a.Counton the end of that and get the number of options. I don't know if you have the equivalent in VBA but I'm assuming you do since you have a.AsSelect. If I were to guess, it would be something like.FindElementById(...).AsSelect.Options. If you have Intellisense, when you type.after.AsSelectyou should get a list of methods/properties. Look through that list and see what you can find.