operachromiumdriver icon indicating copy to clipboard operation
operachromiumdriver copied to clipboard

Quit() lets the browser running

Open Elmue opened this issue 9 years ago • 5 comments

There is a problem in the Opera webdriver :

Calling driver.Quit() shuts down correctly the webdriver but may let the Opera browser running.

Important: This happens ONLY if you set the path to the executable with: OperaOptions.BinaryLocation = "C:\Program Files\Opera\launcher.exe";

while when setting the path to OperaOptions.BinaryLocation = "C:\Program Files\Opera\34.0.2036.25\opera.exe";

it will work correctly.

Selenium users will not understand what is wrong there: The browser starts, all tests execute correctly but at the end the browser keeps running forever.

SOLUTION: The Selenium driver should throw an exception if the user passes a path to "....\launcher.exe" instead of the "....\opera.exe".

Elmue avatar Jan 06 '16 21:01 Elmue

Is this still an issue? Using "launcher.exe" Opera won't quit. but using "version\opera.exe" implies to change the code each time there is a browser update :/

dventurino avatar Dec 20 '16 15:12 dventurino

but using "version\opera.exe" implies to change the code each time there is a browser update

You did not undestand the point. Please read my posting once more, but more thoroughly!

If you do NOT specify a BinaryLocation the webdriver will automatically start an Opera browser which he choses by an internal algorithm. (I did not study the code how it does)

But what I am talking about is what happens when the caller of the opera driver specifies explicitely one of the installed Opera versions by giving a direct path to one of the Opera.exe.

You will execute the following line ONLY if you want to start explicitely the version 34.0.2036.25.

OperaOptions.BinaryLocation = "C:\Program Files\Opera\34.0.2036.25\opera.exe";

Otherwise this line of code would make no sense and you could omit it because the webdriver will chose automatically which Opera version it starts (I suppose it will start the latest version)

It is not mandatory to specify a BinaryLocation .

But if someone decides to pass an explicit binary path then this MUST be a path to an opera.exe and NOT to the Launcher.exe.

In the case that the caller specifies a BinaryLocation it must NOT be allowed to pass the path of Launcher.exe because the browser cannot be quit.

Apart from that it would be NONSENSE to manually pass the path of Launcher.exe because the idea of OperaOptions.BinaryLocation is to chose ONE SPECIFIC version of Opera and NOT let Launcher.exe decide which version will be started!

If quitting the browser does not work this is a SEVERE bug ! Imagine you run many tests and at the end you have 20 Opera browsers open ALTHOUGH your code calls Quit for each of them!! This is absolutely a NO-GO.

Is this still an issue?

Well, you ask this after exactly one year. This means that the Opera project is completely dead. There is nobody who cares about bugreports during ONE YEAR ! At the end it it is not an issue because nobody uses Opera. This browser has so many bugs, that people don't use it. The majority uses Chrome and Firefox and I think testing a website on these browsers is enough.

Elmue avatar Dec 28 '16 14:12 Elmue

Maybe I'm doing something wrong: if I do not specify a binary path, the operachromiumwebdriver launches Chrome instead of Opera (I've got a test machine with all the web browsers installed). I'm not sure if I'll keep on testing my application against Opera though...

Anyway, could you share the code you use to start Opera?

dventurino avatar Jan 09 '17 09:01 dventurino

You are completely right. I looked into the code that I wrote a year ago and it is even worse: The stupid Opera driver is not able to find Opera.exe. It is really a shame how this crap has been programmed!

Normally Opera should write the install path into HKEY_LOCAL_MACHINE\SOFTWARE\Opera But it does not.

So I have to read it from HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\OperaXXX\InstallLocation

and search the subfolders for Opera.exe

Elmue avatar Jan 10 '17 02:01 Elmue

With the latest opera + the driver 2.27 this is still an issue 👎

markvantilburg avatar Jun 25 '17 10:06 markvantilburg