Closed alaahong closed 2 years ago
@alaahong, thank you for creating this issue. We will troubleshoot it as soon as we can.
Triage this issue by using labels.
If information is missing, add a helpful comment and then I-issue-template
label.
If the issue is a question, add the I-question
label.
If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted
label.
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable G-*
label, and it will provide the correct link and auto-close the
issue.
After troubleshooting the issue, please add the R-awaiting answer
label.
Thank you!
@rkrupski as you point the w3c usage on OperaDriver on another post, so do you have any comment on why OperaDriver doesn't set W3C as true by default?
and to what extent is it departing from chromedriver in other ways?
We could figure out a fix for DevToolsActivePort
, but on Mac I'm now getting:
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: unrecognized Chrome version: 1.0.0
Which means something in Opera or chromedriver changed in the past 6 months. 😞
Ruby bindings haven't directly supported Opera for the past 6+ years, and Sauce Labs has never supported it, without (much) complaint. I'm not sure how much energy to put into this one unless we can work together on a fix. Especially as we start pushing more toward async / BiDi solutions in Selenium.
Found a solution unexpectedly by comparing java and dotnet implementation and documentation on selenium.dev.
Solution was to prepare proper ChromeOptions:
1) set binary to location of launcher.exe
2) set start arguments: "--remote-debugging-port=9222", "--no-sandbox", "--disable-dev-shm-usage"
3) ! force set "w3c" to true.
In java this is quite simple: options.setExperimentalOption("w3c", true);
In C# such capability is forbidden as already known, so I had to use the reflection to forcibly add it to additionalChromeOptions private dictionary in ChromiumOptions class:
var field = typeof(ChromiumOptions).GetField("additionalChromeOptions", BindingFlags.NonPublic | BindingFlags.Instance);
if (field.GetValue(options) is Dictionary<string, object> optionsDictionary)
{
optionsDictionary["w3c"] = true;
field.SetValue(options, optionsDictionary);
}
options.BinaryLocation = BinaryLocation;
4) You need to use operadriver executable, not the chromedriver. You can check out the latest operadriver here: https://github.com/operasoftware/operachromiumdriver/releases . And you need to tell the ChromeDriver that you're using it when instantiating.
var driver = new ChromeDriver(ChromeDriverService.CreateDefaultService(driverDir, "operadriver.exe"), options);
Hope this would help to somebody else =)
I'm working now on integration of these actions into the Aquality.Selenium nuget package, you can check out our solution - we have cross-browser support with easy json configuration. Template project is located here: https://github.com/aquality-automation/aquality-selenium-dotnet-template
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.
There is clearly a bug in C# Selenium version with unability to set the "w3c" option, but Selenium devs decided to close the issue... That's sad, but no suprises. Check out our Aquality.Selenium framework — we're supporting work with different browsers including Opera, even if Selenium refuses to support them.
@mialeska, It's a feature not a bug. The problem is that Opera does not support the functionality that Selenium currently requires. We've reached out to Opera devs multiple times and have not gotten any response.
If you need Opera, you can use an older version of Selenium, because Opera can't make use of the recent features, anyway.
@mialeska we are also interested in collaborating, have a look at https://twitter.com/SeleniumHQ/status/1540332236746145798
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.
What happened?
2 points.
But as below code, Opera support W3C by additional option, so do we still need remove Opera in Selenium? JWP -->
W3C
reference: https://github.com/operasoftware/operachromiumdriver/issues/96#issuecomment-985291083 https://github.com/operasoftware/operachromiumdriver/issues/100#issuecomment-1134277851
But throw exception on my side
But chromeOptions with deprecated OperaDriver is fine, (it still need work with opera driver)
So, any solution if user want to work with Opera by Selenium 4?
How can we reproduce the issue?
Relevant log output
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