-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Opera 87 - no operadriver? #100
Comments
@rkrupski |
@rkrupski I have another question to ask, and it may affect Omer Faruk Boran (above) also. (I am wondering what version of Selenium Omer is using.) I have been unable to use the newest version – 4, with Opera. When I ask the people in the selenium chat, they tell me that the operadriver is not supported in selenium 4 because it is not compliant with W3 webdriver standards. It seems like Selenium 4 is more exacting than older selenium versions. Compatibility with Selenium is a really big thing for people like me who do automated testing of critical sites – I would love it if operadriver incompatibility issues could be fixed. Using an old version causes a number of problems that I need to compensate for with other browsers. Thanks. |
@krb-vci, that's true, in Selenium bindings OperaOptions is still using old naming which is invalid to the W3C. However, there is a workaround - please have a look at my past comment. @omerboran63 try to use the above workaround (initialize |
@rkrupski - I am completely confused. I am trying to initiate Opera in C#.
Clearly this is a problem because I am pointing to the directory where I put the drivers, but I do not name the operadriver.exe. I have no idea how to do that and cannot find documentation on it. Can you help me understand how to set the options and the driver? |
@krb-vci Regarding location of operadriver. In Python I can use something like this: Sample code in Python to drive Opera from a given location using webdriver (+ selenium 4) from a specific folder would look as follow:
|
@rkrupski - I am still not succeeding. The C# implementation is clearly different from the Python implementation. The C# selenium library ( namespace OpenQA.Selenium.Chromw) does not have "add_experimental_option." One error message I got while trying different possibilities suggested using the options.UseSpecCompliantProtocol property - but that did not work either. I am hoping someone who knows the C# library reads this and responds. I'm still kind of a newbie, and struggling with lack of documentation details. |
You can try:
|
@WhoAmI-2022 operadriver class is no longer supported in selenium 4. Only 3.141 and earlier. |
The right way to use Opera in Selenium 4.2+ is to use See relevant language examples here: The lack of updates to this project and not getting a response to issue #88 led us to choose to remove support for it. Chromedriver will successfully drive Opera in the required protocol. |
Found a solution unexpectedly by comparing java and dotnet implementation and documentation on selenium.dev.
Hope this would help you @krb-vci 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 |
Alaksiej,
That is excellent. I changed my code to be as shown below. It is definitely launching the Opera browser – but then crashes. The error message I get is below the code.
I’d really appreciate any further guidance, and really appreciate your comment below. This has been bothering me for months, and I have been stuck using the old selenium webdriver.
Thanks,
Ken
My code:
IWebDriver driver;
string driverDir = AppDomain.CurrentDomain.BaseDirectory + "Drivers"; // NOTE – this is where I keep copies of the latest chromedriver – as well as edge and firefox and other drivers.
BrowserBrand = "Opera";
string operaExeLocation = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\AppData\Local\Programs\Opera\89.0.4447.91\opera.exe";
string operaLauncherExeLocation = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\AppData\Local\Programs\Opera\launcher.exe";
ChromeOptions options = new ChromeOptions();
options.AddArgument("start-maximized");
options.AddArgument("disable-infobars");
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 = operaLauncherExeLocation;
driver = new ChromeDriver(driverDir, options);
…---
Here’s the error message ( I edited some personal stuff that won’t matter to you):
OpenQA.Selenium.WebDriverException
HResult=0x80131500
Message=unknown error: Chrome failed to start: exited normally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location C:\Users\myname\AppData\Local\Programs\Opera\launcher.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Source=WebDriver
StackTrace:
at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute)
at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.WebDriver.StartSession(ICapabilities desiredCapabilities)
at OpenQA.Selenium.WebDriver..ctor(ICommandExecutor executor, ICapabilities capabilities)
at OpenQA.Selenium.Chromium.ChromiumDriver..ctor(ChromiumDriverService service, ChromiumOptions options, TimeSpan commandTimeout)
at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout)
at OpenQA.Selenium.Chrome.ChromeDriver..ctor(String chromeDriverDirectory, ChromeOptions options, TimeSpan commandTimeout)
at OpenQA.Selenium.Chrome.ChromeDriver..ctor(String chromeDriverDirectory, ChromeOptions options)
at IIWeb11Tests.Classes.Helpers.SetDriver(BrowserTypes brwsr, String& BrowserBrand, Boolean disablePopupBlocking) in C:\Users\myname\ Web-Testing\Classes\Helpers.cs:line 5496
at WebTests.MainViewTest() in C:\Users\myname\Web-Testing\MainTest.cs:line 238
|
@krb-vci the thing I forgot to mention - it would not work with the chromedriver.exe. 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.
And if you decide to use the WebDriverManager:
|
Fantastic! Thank you! |
@mialeska - |
I'm not sure what might cause this issue - maybe you're sharing the same remote debugging port(the one added as argument, 9222). |
Thanks for your note. I fixed the problem by using port 1212 for the remote debugging port for the second driver instance. I have not yet tried WebDriverManager - but will. I have been making a lot of changes in the project and will try it soon. |
Rafal,
Thank you. I have it working now.
I have another question to ask, and it may affect Omer Faruk Boran also.
For Omer I am wondering what version of Selenium he is using. I have been unable to use the newest version – 4, with Opera. When I ask the people in the selenium chat, they tell me that the operadriver is not supported in selenium 4 because it is not compliant with W3 webdriver standards. It seems like Selenium 4 is more exacting than older selenium versions.
I run with Selenium 3.141.0 – which is most recent version before the release of 4.0.
Compatibility with Selenium is a really big thing for people like me who do automated testing of critical sites – I would love it if operadriver incompatibility issues could be fixed. Using an old version causes a number of problems that I need to compensate for with other browsers.
Thanks.
From: Rafal Krupski ***@***.***>
Sent: Friday, May 20, 2022 8:41 AM
To: operasoftware/operachromiumdriver ***@***.***>
Cc: Ken Blaker ***@***.***>; Author ***@***.***>
Subject: Re: [operasoftware/operachromiumdriver] Opera 87 - no operadriver? (Issue #100)
It looks like an issue with default sorting of release on GitHub as the latest one displayed is Opera 85 indeed, but as you can see on page 3<https://github.com/operasoftware/operachromiumdriver/releases?page=3> webdrivers for both Opera Stable 87 and Opera Stable 86 were uploaded.
Here<https://github.com/operasoftware/operachromiumdriver/releases/tag/v.101.0.4951.64> is the link to "proper" latest release.
—
Reply to this email directly, view it on GitHub<#100 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AH4Y5AZEHT3IH3UHEIFAE3LVK6XBVANCNFSM5WM7FTLA>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Is Opera no longer publishing new versions of operadriver? The latest here, updated 2 months ago, is for Opera 85. I test a health care website, and we can only support browsers that can be tested and documented. Without a working driver I am forced to stop supporting Opera, and to direct all the health care users to browsers I can test and document.
I'd like to be able to support Opera, especially for users in Europe, but need a standards-compliant webdriver.
Any chance of seeing one soon, or should my organization and I give up and start directing all users to Edge?
The text was updated successfully, but these errors were encountered: