New safaridriver with Safari 10.0 macOS Sierra

3,550 views
Skip to first unread message

Alexander Ustinov

unread,
Jun 20, 2016, 3:22:14 AM6/20/16
to Selenium Users
There is new feature safaridriver in the new version macOS Sierra.
command /usr/bin/safaridriver launch daemon /usr/libexec/wedriverd on some port (70XX)

How to use this option with selenium? :)

David

unread,
Jun 20, 2016, 2:02:10 PM6/20/16
to Selenium Users
Ask Apple - check their support forums, docs?

As this isn't natively integrated into Selenium WebDriver bindings (like the current/old SafariDriver pre-Sierra), I would assume to use it, you would use RemoteWebDriver against the port you're using the new SafariDriver with and specify Safari desired capabilities, all after launching the Sierra SafariDriver on some given port. Then it should just work like any browser. And hopefully this new SafariDriver doesn't have the limitations of the current one (e.g. Action chains, native interactions API, javascript alert handling, file upload support).

As for Selenium Grid support, we'll have to see how you run the new driver binary with grid / in grid mode. Hopefully that's documented somewhere.
Message has been deleted
Message has been deleted

Jai P

unread,
Oct 12, 2016, 10:42:32 PM10/12/16
to Selenium Users

I have followed the instructions for Safari 10 automation on Sierra. I am using a Java client and am unable to launch Safari with RemoteWebDriver(capabilities) and with SafariDriver instantiation, like

 

DesiredCapabilities capabilities = DesiredCapabilities.safari();
capabilities
.setCapability(SafariOptions.CAPABILITY, new SafariOptions());
driver
= new SafariDriver(capabilities);


 

I get this during visibility check of a WebElement -

 org.openqa.selenium.UnsupportedCommandException: Build info: version: '3.0.0-beta4', revision: '3169782', time: '2016-09-29 10:30:04 -0700'
System info: host: 'Jai-Padmanabhans-MacBook-Pro.local', ip: '192.168.52.125', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12', java.version: '1.8.0_60'
Driver info: org.openqa.selenium.safari.SafariDriver
Capabilities [{applicationCacheEnabled=true, rotatable=false, databaseEnabled=true, handlesAlerts=true, version=12602.1.50, cleanSession=true, platform=MAC, nativeEvents=true, locationContextEnabled=false, webStorageEnabled=true, browserName=safari, javascriptEnabled=true, cssSelectorsEnabled=true}]


 

I know SafariDriver should not be used as mentioned in the article but there seems to be a 3.0.0-beta4 jar for safaridriver and it does launch Safari. Can you point me in the right direction?


On Tuesday, September 27, 2016 at 6:15:27 PM UTC-4, Hemanth B S wrote:
I got it working by setting the path in .bash_profile and updating my selenium to the latest jar.


I followed this and I got it to work.

Vanya

unread,
Oct 17, 2016, 8:16:24 AM10/17/16
to Selenium Users
The same error happens for me with when I try to use Fluent wait for element is displaying:

org.openqa.selenium.UnsupportedCommandException: Build info: version: '3.0.0', revision: '350cf60', time: '2016-10-13 10:48:16 -0700'
System info: host: '<host>', ip: '<ip>', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12', java.version: '1.8.0_65'
Driver info: org.openqa.selenium.safari.SafariDriver
Capabilities [{applicationCacheEnabled=true, rotatable=false, databaseEnabled=true, handlesAlerts=true, version=12602.1.50, cleanSession=true, platform=MAC, nativeEvents=true, locationContextEnabled=false, webStorageEnabled=true, browserName=safari, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: D055A002-CB72-42AF-9D58-F05162E228D1
Command duration or timeout: 1.92 seconds
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:216)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:635)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:274)
at org.openqa.selenium.remote.RemoteWebElement.isDisplayed(RemoteWebElement.java:315)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.openqa.selenium.support.pagefactory.internal.LocatingElementHandler.invoke(LocatingElementHandler.java:51)
at com.sun.proxy.$Proxy26.isDisplayed(Unknown Source)
at org.openqa.selenium.support.ui.ExpectedConditions.elementIfVisible(ExpectedConditions.java:302)
at org.openqa.selenium.support.ui.ExpectedConditions.access$100(ExpectedConditions.java:41)
at org.openqa.selenium.support.ui.ExpectedConditions$10.apply(ExpectedConditions.java:288)
at org.openqa.selenium.support.ui.ExpectedConditions$10.apply(ExpectedConditions.java:285)
at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:238)

MD

unread,
Nov 5, 2016, 3:18:03 AM11/5/16
to Selenium Users
Hi Jai,
Visibility check of element is broken on Safari10, I faced the same issue, however on Safari technology  preview version 16 its working fine. so you need to install Safari Technology preview on MAC os Seirra and use the following capability

desiredCapabilities
= DesiredCapabilities.safari();
SafariOptions safariOptions = new SafariOptions();
safariOptions
.setUseCleanSession(true);
safariOptions
.setUseTechnologyPreview(true);
desiredCapabilities
.setCapability(SafariOptions.CAPABILITY, safariOptions);

Hemanth B S

unread,
Dec 5, 2016, 3:44:01 PM12/5/16
to Selenium Users
Hi Thank you for your reply.

I am able to run the safaridriver using the below code

public class Test {


public static void main(String[] args) {

DesiredCapabilities desiredCapabilities = DesiredCapabilities.safari();

SafariOptions safariOptions = new SafariOptions();

safariOptions.setUseCleanSession(true);

desiredCapabilities.setCapability(SafariOptions.CAPABILITY, safariOptions);

desiredCapabilities.setCapability(SafariOptions.CAPABILITY, new SafariOptions()); 

WebDriver driver = new SafariDriver(desiredCapabilities);

driver.get("http://etnabeta.cimm2.com");

driver.quit();

}


My selenium version is 3.0.0 . How do run the same using selenium grid. I am not able to run safaridriver using selenium grid. Please help.

Regards,

Hemanth Sridhar

Nikol Marku

unread,
Mar 10, 2017, 4:39:41 AM3/10/17
to Selenium Users
Selenium 3.1.0
Safari 10.0.3 or Safari preview V25
UnsupportedCommandException   for is Displayed NOT FIXED
and maximize does not work and surely there will lot more 
Reply all
Reply to author
Forward
0 new messages