I've tried a few options from scouring the web and I think my problem is I have Option Explicit set and I don't know which are variables to declare and what to declare them as. My code snippet is below. Basically I want to count how many elements are in the dropdown clicked here: .FindElementByXPath("//div[1]/*[name()='svg'][1]"). I then want to replace the 300 below with the count of elements. Any help is appreciated!
Dim iTotalScore As Integer
Dim iNameCount As Integer
Dim iNameCountTotal As Integer
Dim sName As String
Dim d As WebDriver
Set d = New ChromeDriver
With d
.Start "Chrome"
.Get "https://someurl.com"
For iNameCount = 1 To 300
.FindElementByXPath("//div[1]/*[name()='svg'][1]").Click
Application.Wait (Now + TimeValue("0:00:03"))
'do bunch of stuff
Next iNameCount
Dim iTotalScore As Integer
Dim iNameCount As Integer
Dim iNameCountTotal As Integer
Dim sName As String
Dim d As WebDriver
Set d = New ChromeDriver
With d
.Start "Chrome"
.Get "https://someurl.com"
For iNameCount = 1 To 300
.FindElementByXPath("//div[1]/*[name()='svg'][1]").Click
Application.Wait (Now + TimeValue("0:00:03"))
'do bunch of stuff
Next iNameCount