title: Vba code to click on next page using firefox
body: <p>I have vba code with the help of this code i am able to click on next page in website using internet explorer but i want this code to work in firefox.</p>
  
  <p>Please find the below code</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>Dim lis As IHTMLElementCollection
  Dim nextLi As HTMLLIElement, n As Long
  Set lis = IE.document.getElementsByTagName("LI")
  Set nextLi = Nothing
  n = 0
  While n &lt; lis.Length And nextLi Is Nothing
  If lis(n).innerText = "Next" Then Set nextLi = lis(n)
  n = n + 1
  Wend
  If Not nextLi Is Nothing Then
  nextLi.Click
  End If</code></pre>
  </div>
  </div>
  </p>
  
  <p>The code which i have try for firefox</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>Sub test() 
  Dim driver As New Selenium.FirefoxDriver
  Dim lis As IHTMLElementCollection 
  Dim nextLi As HTMLLIElement, n As Long 
  driver.Get "url" 
  driver.Timeouts.Server = 120000 
  driver.Window.Maximize 
  Dim lis As IHTMLElementCollection
  Dim nextLi As HTMLLIElement, n As Long
  Set lis = driver.findElementsByTagName("LI")
  Set nextLi = Nothing
  n = 0
  While n &lt; lis.Length And nextLi Is Nothing
  If lis(n).innerText = "Next" Then Set nextLi = lis(n)
  n = n + 1
  Wend
  If Not nextLi Is Nothing Then
  nextLi.Click
  End If
  End Sub</code></pre>
  </div>
  </div>
  </p>