Search code examples
rseleniumoperarselenium

Running RSelenium with Opera


I am trying to use RSelenium with Opera (Version 72). I already downloaded the current version of the opera drivers from https://github.com/operasoftware/operachromiumdriver/releases.

However, I am facing two problems which I did not figure out yet.

What`s the procedure for installing the opera drivers? I ran the .exe, but only some lines in the win console appeared.

What is the right code? My latest try is:

remDr = remoteDriver(remoteServerAddr = "localhost", port = 4444, browserName = "opera",extraCapabilities = list("opera.binary" = "C:[..]/operadriver.exe"))
(I also tried remDr = remoteDriver([...] /launch.exe"))
remDr$open() 

In doing this, I got the response:

"Undefined error in httr call. httr output: Failed to connect to localhost port 4444: Connection refused"

Thanks for any suggestions.


Solution

  • [ Download the opera driver and Opera ]

    The download process also can be automated (however not posting it here)

    Then

    se <- wdman::selenium(
      check = FALSE,
      jvmargs = list(
        opera =
          paste0(
            "-Dwebdriver.opera.driver=",
            normalizePath(
              "<give correct path>/operadriver.exe"
            )
          )
      ))
    
    rd <- RSelenium::remoteDriver(browserName = "opera", port = 4567L)
    rd$open()