0

I'm trying to use selenium to run tests using brave browser (I've already got it running for chrome, IE and firefox)

I found this post How to run Selenium tests on the Brave web browser?

which suggests using:

from selenium import webdriver
option = webdriver.ChromeOptions()
option.binary_location = r'C:\Program Files (x86)\BraveSoftware\Brave-Browser\Application\brave.exe'
driver = webdriver.Chrome(executable_path=r'C:\WebDrivers\chromedriver.exe', options=option)
driver.get("https://www.google.com")

However that's for python I believe and I can't work out how to do the equivalent in VBA

Michael Liew
  • 273
  • 3
  • 12
  • Do you mind sharing what you have tried so far? Are you getting any error? – itronic1990 Jun 07 '21 at 13:03
  • I actually haven't tried anything. I'm not too sure how to do it in VBA and the only posts I've been able to find seem to be for python (like in the link i provided in original post) – Michael Liew Jun 07 '21 at 13:46

1 Answers1

0

You need to ensure the executable (chromedriver) is in the selenium basic folder or on the environmental path (see here, then you can set the path to the binary using .SetBinary

No idea if will work even though apparently it is chromium based.

This is adapted from examples.xlsm on the selenium basic github site.

Private Sub Use_Brave()
  Dim driver As New ChromeDriver
  driver.SetBinary "C:\Program Files (x86)\BraveSoftware\Brave-Browser\Application\brave.exe"
  driver.Get "https://www.google.com"
  driver.Quit
End Sub
QHarr
  • 83,427
  • 12
  • 54
  • 101