How to use OperaChromiumDriver for opera version >12.X

后端 未结 3 2191
暖寄归人
暖寄归人 2020-12-19 15:09

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 o

3条回答
  •  情歌与酒
    2020-12-19 15:35

    OperaChromiumDriver now works with Opera 26+ but only with a remote instance so far... Download and launch the appropriate binary from

    OperaChromiumDriver Binary Releases

    They have examples for Desktop versions in python but here's what worked for me in Java. Many ChromeOptions do not work though it says they should... you will have to test to know for sure but the setBinary does work.

    DesiredCapabilities capabilities = DesiredCapabilities.opera();
    
    ChromeOptions options = new ChromeOptions();
    options.setBinary("/path/to/opera");
    
    capabilities.setCapability(ChromeOptions.CAPABILITY, options);
    
    driver = new RemoteWebDriver(new URL("http://127.0.0.1:9515"),capabilities);
    

提交回复
热议问题