seleniumhq.github.io icon indicating copy to clipboard operation
seleniumhq.github.io copied to clipboard

[🐛 Bug]: clarify that Service should be instantiated from the browser-specific class

Open raffaem opened this issue 2 years ago • 3 comments

What happened?

In this webpage there is written:

service = Service(executable_path=ChromeDriverManager().install())

But the argument to Service.__init__, as also described in the documentation, seems to be executable, not executable_path

What browsers and operating systems are you seeing the problem on?

OS: Fedora Workstation 35 Browser: Firefox

raffaem avatar Feb 28 '22 12:02 raffaem

Hi @raffaem,

May be you're looking into wrong documentation. webdriver-manager is a third party library. So you need to look webdriver-manager specific doc https://github.com/SergeyPirogov/webdriver_manager.

As per their documentation, it is how it works!

Service(executable_path=ChromeDriverManager().install())

returns executable in short!

Hope this helps!

harsha509 avatar Mar 01 '22 05:03 harsha509

Hi @harsha509,

no I did not confuse the two projects, and I linked the Selenium's documentation, not webdriver-manager documentation.

However I was using the wrong workflow, as I was instancing selenium.webdriver.common.service.Service, which takes esecutable as an argument, instead of the browser-specific class, e.g. selenium.webdriver.chrome.service.Service which indeed takes executable_path as an argument.

I think this webpage should make clear that you have to instantiate Service from the browser-specific class, not from the common class.

raffaem avatar Mar 01 '22 05:03 raffaem

Got it.

Docs need to be updated on instantiating Service from the browser-specific class. Would you help us with a PR if possible ?

Here are the contribution guidelines for reference!

harsha509 avatar Mar 01 '22 05:03 harsha509

Closing as we did not get more information.

diemol avatar Aug 19 '22 11: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 19 '22 02:09 github-actions[bot]