question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[🐛 Bug]: Opera Browser in Selenium 4 Usage

See original GitHub issue

What happened?

2 points.

  1. As commit message mentioned, Selenium Deprecated Opera Support by non-W3C support [java] Add deprecated warnings to OperaDriver and OperaOptions

But as below code, Opera support W3C by additional option, so do we still need remove Opera in Selenium? JWP -->

@Test
  public void operaOptionsTest() {
     operaOptions = new OperaOptions();
//    operaOptions.setExperimentalOption("w3c",true);
    driver = new OperaDriver(operaOptions);
    driver.get("https://www.bing.com/"); 
  }
//in log --> 7月 02, 2022 12:01:49 上午 org.openqa.selenium.remote.ProtocolHandshake createSession
信息: Detected upstream dialect: OSS

W3C

@Test
public void operaOptionsTest() {
  operaOptions = new OperaOptions();
  operaOptions.setExperimentalOption("w3c",true);
  driver = new OperaDriver(operaOptions);
  driver.get("https://www.bing.com/");
} // in log --> 7月 02, 2022 12:05:22 上午 org.openqa.selenium.remote.ProtocolHandshake createSession
信息: Detected upstream dialect: W3C

reference: https://github.com/operasoftware/operachromiumdriver/issues/96#issuecomment-985291083 https://github.com/operasoftware/operachromiumdriver/issues/100#issuecomment-1134277851

  1. ChromeDriver doesn’t not work well with Opera As doc mentioned, it expect to work under ChromeOptions https://www.selenium.dev/documentation/webdriver/getting_started/open_browser/#opera

But throw exception on my side

@Test
public void operaWithChromeOptionsTest() {
  // ChromeDriver is 102.0.5005.61
  // Opera is 88 based on Chrome/102.0.5005.115
  chromeOptions = new ChromeOptions();
  chromeOptions.setBinary("/${OPERA_HOME}/opera.exe");
  driver = new ChromeDriver(chromeOptions);
  driver.get("https://www.ianzhang.cn/");
}
// org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: Chrome failed to start: exited normally.
//  (unknown error: DevToolsActivePort file doesn't exist)

image

But chromeOptions with deprecated OperaDriver is fine, (it still need work with opera driver)

@Test
public void operaWithChromeOptionsAndOperaDriverTest() {
  chromeOptions = new ChromeOptions();
  chromeOptions.setBinary("/${OPERA_HOME}/opera.exe");
  driver = new OperaDriver(chromeOptions);
  driver.get("https://www.ianzhang.cn/");
}

So, any solution if user want to work with Opera by Selenium 4?

How can we reproduce the issue?

See above

Relevant log output

See above

Operating System

Windows 11

Selenium version

4.3.0

What are the browser(s) and version(s) where you see this issue?

Opera 88 (based on Chrome 102)

What are the browser driver(s) and version(s) where you see this issue?

OperaDriver 102, ChromeDriver 102

Are you using Selenium Grid?

No

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
titusfortnercommented, Aug 19, 2022

Opera is “officially” no longer supported in Selenium because there is not a compatible driver for it. The chromedriver now requires things that Opera does not support and operadriver does not appear to be updated with latest w3c support. If and when this changes, we can revisit support for it in Selenium.

0reactions
github-actions[bot]commented, Sep 22, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Opera webdriver is not starting on Selenium 4 - Stack Overflow
I am trying to run the webdriver for opera browser under selenium 4. I am using webdriver-manager in my project. The webdriver-manager docs ......
Read more >
Selenium4 Does Not Support Opera Browser..? - YouTube
Selenium 4 does not support opera browser where as selenium 3 does support opera browser.
Read more >
What's new in Selenium 4: Key Features | BrowserStack
Selenium has been the most preferred tool suite when it comes to automated cross-browser testing of web applications.
Read more >
Changes - Selenium
Native support has been removed for Opera and PhantomJS as the WebDriver implementations for these browsers are no longer under active development.
Read more >
Selenium Version 4: An All-New Approach to Automated Testing
Also, the native support for Opera and PhatomJS is eliminated in Selenium 4 because there is no need for WebDriver implementations under ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found