selenium icon indicating copy to clipboard operation
selenium copied to clipboard

[🚀 Feature]: Remove Opera Classes

Open titusfortner opened this issue 3 years ago • 18 comments

Feature and motivation

opera driver has not been updated to support w3c, so we've agreed to remove those classes.

Usage example

Ruby deleted the classes for Selenium 3 release.

Users can use Chromedriver for opera with ChromeOptions class and setBinary with the path to the Opera Browser.

titusfortner avatar Feb 19 '22 21:02 titusfortner

Do you remember if we want to deprecate first and the remove?

diemol avatar Feb 21 '22 09:02 diemol

https://www.selenium.dev/meetings/2022/tlc-01-19/#delete-opera-classes-from-the-bindings-given-that-operadriver-does-not-support-w3c

Deprecate in Java, remove elsewhere

titusfortner avatar Feb 21 '22 13:02 titusfortner

@titusfortner happy enough if i rip out the Opera classes on the python side without deprecation?

symonk avatar Mar 20 '22 17:03 symonk

I saw the deprecation note in the java docs for selenium. Not sure how to tell Selenium Grid to use the Chrome workaround. My grid rejects the session request if I use ChromeOptions and then change 'browserName' to 'Opera'. Without that change the grid just runs the Chrome browser (when you think you've asked for Opera). BTW, this is using the dockerized grid with node-docker. Opera, Chrome, Firefox, Edge are all enabled on the grid and Opera works OK with the deprecated OperaOptions (outside of the w3c issues...).

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.

Caused by: org.openqa.selenium.TimeoutException: java.util.concurrent.TimeoutException
Build info: version: '4.1.3', revision: '7b1ebf28ef'
System info: host: 'test', ip: 'fe80:0:0:0:1843:95ae:fcd0:90b4%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '11.6.5', java.version: '17.0.2'
Driver info: driver.version: RemoteWebDriver
Caused by: java.util.concurrent.TimeoutException

Grid shows this pending session: "acceptInsecureCerts":true,"acceptSslCerts":true,"browserName":"Opera","build":"opera","goog:chromeOptions":{"args":[],"excludeSwitches":["enable-automation"],"extensions":[]},"name":"alfresco_TestAddFolder.createFolder","pageLoadStrategy":"eager","screenResolution":"1272x1024","se.screenResolution":"1272x1024","se:recordVideo":true,"se:timeZone":"America/Chicago","tz":"America/Chicago"}

ibodog avatar Apr 09 '22 15:04 ibodog

@ibodog To use opera:

  1. Do everything the same as if you are using chrome (class names, browser name, etc)
  2. Determine the path to Opera browser binary on node machine
  3. Use the setBinary() method and pass in that path as a string.

If not all nodes will have have both Opera & Chrome installed, then you'll need to set a custom capability in the node and also match that in capabilities https://www.selenium.dev/documentation/grid/configuration/cli_options/#setting-custom-capabilities-for-matching-specific-nodes

titusfortner avatar Apr 09 '22 17:04 titusfortner

I think there is some additional step needed when running the dockerized grid w/node-docker since that node spins up yet another container. Here's what I get when I do everything like Chrome except add the setBinary. In the selenium/standalone-opera docker image the opera binary is located at "/usr/bin/opera". MutableCapabilities caps = new ChromeOptions(); ((ChromeOptions) caps).setBinary("/usr/bin/opera");

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: Could not start a new session. Could not start a new session. Unable to create session: Could not start a new session. Response code 500. Message: Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: unknown error: no chrome binary at /usr/bin/opera

ibodog avatar Apr 10 '22 02:04 ibodog

If you have the opera browser at that location, you won't get that message.

@diemol is there something that I'm missing wrt the docker containers?

titusfortner avatar Apr 10 '22 13:04 titusfortner

@ibodog the Docker image for Opera is not available for Selenium Grid 4. The one you reference was the last one created for Selenium Grid 3. So I would not expect it to work with the Dynamic Grid (node-docker). Also, to do what @titusfortner is pointing out, you would need to have ChromeDriver available and clearly the selenium/standalone-opera does not have it.

Probably you need to build your own Docker image with Opera using Selenium 4.

diemol avatar Apr 10 '22 18:04 diemol

Have been using that selenium/standalone-opera image w/node-docker Selenium Grid 4 for a couple of months and only seeing the W3C non-compliance issues w/the Opera driver (most tests ran fine). Didn't notice that the image wasn't being actively maintained.

ibodog avatar Apr 11 '22 17:04 ibodog

Java looks at the code getting sent and makes a guess about what you probably want to do and then tries to compensate based on the end node protocol. It mostly works so you won't notice the difference, but it has a number of issues and we're looking at removing the functionality going forward as that is going to be much easier than trying to fix it.

titusfortner avatar Apr 11 '22 18:04 titusfortner

Python - 6b01d3518a48899f9904f96fc506e689e1047f68

titusfortner avatar May 10 '22 13:05 titusfortner

.NET 6dcef3a7f8a0830e644fb366d0a556f9722fa384

titusfortner avatar May 10 '22 13:05 titusfortner

Java b3f9d377d04dcefb5bfbc6fbdaffccf946bfedda

titusfortner avatar May 10 '22 14:05 titusfortner

Java & Python are only deprecated, so everything is ready for 4.2 Opera will be removed in Java & Python for 4.3

titusfortner avatar May 10 '22 14:05 titusfortner

This is milestoned 4.3 - @titusfortner I'll let you merge this: https://github.com/SeleniumHQ/selenium/pull/10630 i we are happy to bring it in, I think it is good for merging if you are happy, thanks! (test failures are unrelated)

symonk avatar Jun 10 '22 23:06 symonk

Dropping C-py as merged to trunk

symonk avatar Jun 18 '22 22:06 symonk

Let's remove it in Java in 4.5 not 4.4

titusfortner avatar Jul 20 '22 14:07 titusfortner

This issue is looking for contributors.

Please comment below or reach out to us through our IRC/Slack/Matrix channels if you are interested.

github-actions[bot] avatar Jul 20 '22 18:07 github-actions[bot]

Java PR was merged a moment ago, closing.

diemol avatar Aug 18 '22 09:08 diemol

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.

github-actions[bot] avatar Sep 18 '22 00:09 github-actions[bot]