本文介绍了如何将OperaChromiumDriver用于Opera版本> 12.X的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道要在歌剧版本> 12.X上工作,已经开发了Operachromiumdriver.同时,我无法使它正常工作.我从 https://github.com/operasoftware/operachromiumdriver/releases,但无济于事.有人可以帮我弄这个吗 .请告诉我我的理解是否正确.

I understand that to work on opera versions > 12.X, Operachromiumdriver has been developed. At the same time I couldn't get this to work. I downloaded the windows version of operachromiumdriver.exe from https://github.com/operasoftware/operachromiumdriver/releases but to no avail. Can someone help me with this . Please tell me if my understanding is right.

谢谢

推荐答案

我发现使用OperaChromiumDriver.exe运行Opera 25+的解决方案.

I have found the solution running opera 25+ using OperaChromiumDriver.exe.

  1. 安装Opera 25+(我安装了Opera 25)
  2. 下载OperaChromiumDriver https://github.com/operasoftware/operachromiumdriver/releases
  3. 将zip文件提取到计算机上的某个位置
  4. 使用以下代码打开Opera

  1. Install Opera 25+ (I installed Opera 25)
  2. Download OperaChromiumDriver https://github.com/operasoftware/operachromiumdriver/releases
  3. Extract the zip file to a location on the computer
  4. Use the following code to open Opera

System.setProperty("webdriver.chrome.driver", "C:/Users/user/Downloads/operadriver-0.1.0-win32/operadriver-0.1.0-win32.exe");
WebDriver driver = new ChromeDriver();
driver.get("https://www.google.com");
driver.findElement(By.name("q")).sendKeys("Selenium");

我用过new ChromeDriver().由于我们正在使用OperaChromiumDriver,因此这将启动Opera.我认为这是因为新的Opera是基于Chromium的,而OperaChromiumDriver是从ChromeDriver派生的WebDriver实现[请参见 https://github.com/operasoftware/operachromiumdriver] .

I have used new ChromeDriver(). This will start Opera since we are using OperaChromiumDriver. I think this is because the new Opera is based on Chromium and OperaChromiumDriver is a WebDriver implementation derived from ChromeDriver [See https://github.com/operasoftware/operachromiumdriver].

希望这对您有所帮助.

这篇关于如何将OperaChromiumDriver用于Opera版本> 12.X的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-12 17:39