问题描述
我知道要在歌剧版本> 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.
- 安装Opera 25+(我安装了Opera 25)
- 下载OperaChromiumDriver https://github.com/operasoftware/operachromiumdriver/releases
- 将zip文件提取到计算机上的某个位置
-
使用以下代码打开Opera
- Install Opera 25+ (I installed Opera 25)
- Download OperaChromiumDriver https://github.com/operasoftware/operachromiumdriver/releases
- Extract the zip file to a location on the computer
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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!