如何在Brave Web浏览器上运行Selenium测试? [英] How to run Selenium tests on the Brave web browser?

查看:157
本文介绍了如何在Brave Web浏览器上运行Selenium测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Brave Web浏览器上运行一些Selenium测试.我可以使用ChromeDriver通过Selenium启动Brave Web浏览器.但是,例如,我无法使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?

这是我使用的解码器:

    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 Browser版本兼容.

Nevertheless, be sure to check that your ChromeDriver version is compatible with your Brave Browser version.

这篇关于如何在Brave Web浏览器上运行Selenium测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆