title: Click button in using VBA Chrome selenium
body: <p>Good night<br>
  I want to click the upload image button using chrome selenium<br>
  I've tried to code, but it doesn't work<br><br></p>
  <pre><code>Public Sub CallChrome1()
      Dim ch As Selenium.ChromeDriver
      Dim wsh As Object
      Dim strFolder As String
      
       Set wsh = CreateObject(&quot;Wscript.Shell&quot;)
      strFolder = wsh.regread(&quot;HKCU\Volatile Environment\LOCALAPPDATA&quot;) &amp; &quot;\Google\Chrome\User Data&quot;
      Set ch = New Selenium.ChromeDriver
      
      ch.AddArgument (&quot;user-data-dir=&quot; &amp; strFolder)
      ch.AddArgument (&quot;profile-directory=Default&quot;)
      ch.Start
      ch.Get &quot;https://sellercenter/apps/product/publish&quot;
      Application.Wait (Now + TimeValue(&quot;0:00:05&quot;))
      
      ch.ExecuteScript &quot;window.open(arguments[0])&quot;, &quot;https://sellercenter/apps/mediacenter&quot;
      ch.SwitchToNextWindow
      Application.Wait (Now + TimeValue(&quot;0:00:10&quot;))
      ch.FindElementByXPath(&quot;//a[@class='next-btn next-medium next-btn-primary' and text()='Upload Image']&quot;).Click
         MsgBox &quot;Press OK to Close&quot;
  End Sub
  
  
  
  
  
  </code></pre>
  <p><br><br>
  this is the html 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>&lt;button type="button" class="next-btn next-medium next-btn-primary" role="button"&gt;Upload Image&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>
  <p><a href="https://i.stack.imgur.com/qxMfo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qxMfo.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/V1fyG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/V1fyG.png" alt="enter image description here" /></a></p>
  <br>
  Would appreciate any advice on how to click this button using the Selenium in Excel VBA, thanks.