Skip to content

Commit a5a97c9

Browse files
burglmtierney
authored andcommitted
Improve the error message that is raised when safaridriver cannot be found. (#5739)
Add a link to the Safari download page where Safari and Tech Preview are available.
1 parent 94c503e commit a5a97c9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

py/selenium/webdriver/safari/service.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ def __init__(self, executable_path, port=0, quiet=False):
3434
- port : Port the service is running on """
3535

3636
if not os.path.exists(executable_path):
37-
raise Exception("SafariDriver requires Safari 10 on OSX El Capitan or greater")
37+
if "Safari Technology Preview" in executable_path:
38+
message = "Safari Technology Preview does not seem to be installed. You can download it at https://developer.apple.com/safari/download/."
39+
else
40+
message = "SafariDriver was not found; are you running Safari 10 or later? You can download Safari at https://developer.apple.com/safari/download/."
41+
raise Exception(message)
3842

3943
if port == 0:
4044
port = utils.free_port()

0 commit comments

Comments
 (0)