问题描述
我正在尝试在 Brave 网络浏览器上运行一些 Selenium 测试.我可以使用 ChromeDriver 通过 Selenium 启动 Brave 网络浏览器.但是,没有其他工作,例如我无法让 Brave 加载某个网页.
I am trying to run some Selenium tests on the Brave web browser. I am able to start the Brave web browser through Selenium by using the ChromeDriver. However, nothing else works, e.g. I cannot cause Brave to load a certain web page.
由于 Brave 基于 Chromium,我认为这是要走的路.是否有更合适的方式支持 Brave 由 Selenium 驱动?
As Brave is based on Chromium, I would think this is the way to go. Are there more appropriate ways that support Brave to be driven by Selenium?
这是我使用的解码代码:
This is de code that I used:
ChromeOptions options = new ChromeOptions().setBinary("/Applications/Brave.app/Contents/MacOS/brave");
WebDriver driver = new ChromeDriver(options);
推荐答案
郑重声明:自从 Brave 采用全 Chromium(从 0.57 版开始)后,这不再是问题.我现在可以通过使用问题中包含的代码片段对其进行初始化,将指令传递给 WebDriver.
For the record: this is no longer an issue since Brave went full-Chromium (starting from version 0.57). I can now pass instructions to the WebDriver by initializing it using the code snippet included in the question.
不过,请务必检查您的 ChromeDriver 版本是否与您的 Brave 浏览器版本兼容.
Nevertheless, be sure to check that your ChromeDriver version is compatible with your Brave Browser version.
这篇关于如何在 Brave 网络浏览器上运行 Selenium 测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!