Skip to content
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

safari Webdriver() throws AttributeError with default arguments for python client driver #5578

Closed
mingeth opened this issue Mar 7, 2018 · 12 comments

Comments

@mingeth
Copy link
Contributor

mingeth commented Mar 7, 2018

Meta -

OS: linux
Selenium Version: 3.10.0
Browser: Safari/Version 11.0.3 (13604.5.6)

Expected Behavior -

launching webdriver.Safari() from python with default arguments should create a safaridriver instance

Actual Behavior -

AttributeError: 'WebDriver' object has no attribute 'service'

Steps to reproduce -

from selenium import webdriver
s = webdriver.Safari()
Traceback (most recent call last):
File "", line 1, in
File "/selenium/webdriver/safari/webdriver.py", line 49, in init
self.service.start()
AttributeError: 'WebDriver' object has no attribute 'service'

@mingeth mingeth changed the title safari Webdriver() throws AttributeError with default arguments safari Webdriver() throws AttributeError with default arguments for python client driver Mar 7, 2018
@mingeth
Copy link
Contributor Author

mingeth commented Mar 7, 2018

pull request created at branch python-safari-webdriver-defaultargs

barancev pushed a commit that referenced this issue Mar 13, 2018
Signed-off-by: Alexei Barantsev <barancev@gmail.com>
@barancev
Copy link
Member

PR merged as 2a0f63d

@corytu
Copy link

corytu commented Apr 11, 2018

Sorry, is this fixed in later version of Selenium? I bump into the same problem here.

OS: MacOS 10.13.4
Selenium Version: 3.11.0
Browser: Safari/Version 11.1 (13605.1.33.1.2)

cd /usr/bin
ls | grep safari
# safaridriver
safaridriver --enable
from selenium import webdriver
webdriver.Safari()
# AttributeError: 'WebDriver' object has no attribute 'service'
webdriver.Safari(executable_path='/usr/bin/safaridriver')
# AttributeError: 'WebDriver' object has no attribute 'service'

The traceback I get is exactly the same with @mingeth's.

@lmtierney
Copy link
Member

It is fixed in the trunk and will be in the next release

@ghost
Copy link

ghost commented Apr 12, 2018

OS: MacOS 10.13.4
Selenium Version: 3.11.0
Browser: Safari/Version 11.1 (13605.1.33.1.2)

Hi, is this solved and release updated yet?

I get the same error as @mingeth and @corytu

File ".../selenium/webdriver/safari/webdriver.py", line 49, in init
self.service.start()
AttributeError: 'WebDriver' object has no attribute 'service'

@corytu
Copy link

corytu commented Apr 12, 2018

@suchau3 Please see @lmtierney's comment right above yours.

It is fixed in the trunk and will be in the next release

@mingeth
Copy link
Contributor Author

mingeth commented Apr 12, 2018

@suchau3 @corytu the patch is a two liner -- not difficult to fix on your local.

@mithunsureshqa
Copy link

how do we fix this locally? i am new to this.

@swissbeats93
Copy link

Me too, can someone please help

@da-false9
Copy link

You need to go to the directory where is saved your webdriver.py for Safari.
In my case it's /Users/YOUR_USER_NAME/vitenv/lib/python3.6/site-packages/selenium/webdriver/safari
After this you need to open webdriver.py and to add those 2 strings of the code that were added in the decision for this issue.

@swissbeats93
Copy link

I get more errors after that, specifically which 2 lines should be appended and on which part of web driver.py

@mingeth
Copy link
Contributor Author

mingeth commented Apr 27, 2018

@swissbeats93 look higher up in the thread and you will see the PR merged commit (2a0f63d) by barancev on Mar 13. Click the link to the commit and it will show you the two lines and where to put them in your local copy of webdriver.py.

@lock lock bot locked and limited conversation to collaborators Aug 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants