protractor icon indicating copy to clipboard operation
protractor copied to clipboard

Safari 10 integrated webdriver will fail on browser.executeAsyncScript

Open jeanpylone opened this issue 10 years ago • 11 comments

Hi there!

I tried to run a test suite with the integrated webdriver from Safari 10. It seems to fail on browser.executeAsyncScript with this error undefined is not an object (evaluating 'd.prototype[b].apply'). Same test is ok on chrome.

It may be more webdriver related than protractor, but I didn't really know where to report this issue. Hope this helps!

Edit I justed rollbacked to Safari 9.1.3, the same test works fine.

Bug report

  • Node Version: 4.2.1
  • Protractor Version: 4.0.8
  • Browser(s): Safari 10

a larger extract of the webdriver output: 15:18:25.719 INFO - Executing: [execute async script: return (function (done){ done({isOk: !!window.nonExisting}); }).apply(null, arguments);, []]) 15:18:26.526 WARN - Exception thrown org.openqa.selenium.WebDriverException: undefined is not an object (evaluating 'd.prototype[b].apply') (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 38 milliseconds Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03' System info: host: 'helium.strasbourg.4js.com', ip: '10.0.70.25', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.8.0_102' Driver info: org.openqa.selenium.safari.SafariDriver Capabilities [{browserName=safari, takesScreenshot=true, javascriptEnabled=true, version=10.0, cssSelectorsEnabled=true, platform=MAC, secureSsl=true}] Session ID: null 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:206) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678) at org.openqa.selenium.remote.RemoteWebDriver.executeAsyncScript(RemoteWebDriver.java:598) 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.events.EventFiringWebDriver$2.invoke(EventFiringWebDriver.java:103) at com.sun.proxy.$Proxy1.executeAsyncScript(Unknown Source) at org.openqa.selenium.support.events.EventFiringWebDriver.executeAsyncScript(EventFiringWebDriver.java:229) at org.openqa.selenium.remote.server.handler.ExecuteAsyncScript.call(ExecuteAsyncScript.java:58) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:176) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) 15:18:26.527 WARN - Exception: undefined is not an object (evaluating 'd.prototype[b].apply') (WARNING: The server did not provide any stacktrace information)

jeanpylone avatar Sep 21 '16 13:09 jeanpylone

Thanks - this is probably SafariDriver interpreting something incorrectly but we should figure out what it is and report that issue to them.

juliemr avatar Sep 21 '16 17:09 juliemr

I have same issue on Safari 10, macOS Sierra using webdriver and I do not use protractor... Seems this should be moved to safariDriver list of bugs.

16:54:17.544 INFO - Executing: [set script timeout: 12000])

16:54:17.546 INFO - Done: [set script timeout: 12000] 16:54:17.549 INFO - Executing: [execute async script: /* jshint evil:true /var args = Array.prototype.slice.call(arguments, 0);var code = args[0], fargs = args[1], done = args[2];var wrap = function() { return eval(code);};fargs.push(done);wrap.apply(this, fargs);, [/ jshint evil:true */var args = Array.prototype.slice.call(arguments, 0);var condExpr = args[0], timeout = args[1], poll = args[2], cb = args[3];var waitForConditionImpl = function(conditionExpr, limit, poll, cb) { var res; if ((new Date().getTime()) < limit) { res = eval(conditionExpr); if (res === true ) { cb(res); } else { setTimeout(function() { waitForConditionImpl(conditionExpr, limit, poll, cb); }, poll); } } else { res = eval(conditionExpr); return cb(res); }};var limit = (new Date().getTime()) + timeout;waitForConditionImpl(condExpr, limit, poll, cb);, [var selRoot = document.getElementById("okta-modal");selRoot && selRoot.children.length === 1, 12000, 100]]]) 16:54:17.895 WARN - Exception thrown org.openqa.selenium.WebDriverException: undefined is not an object (evaluating 'd.prototype[b].apply') (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 6 milliseconds Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 17:00:58' System info: host: 'ip-172-23-39-87.us-west-2.compute.internal', ip: '172.23.39.87', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12', java.version: '1.8.0_101' Driver info: org.openqa.selenium.safari.SafariDriver Capabilities [{browserName=safari, takesScreenshot=true, javascriptEnabled=true, version=10.0, cssSelectorsEnabled=true, platform=MAC, secureSsl=true}] Session ID: null

maxzaselian-okta avatar Oct 10 '16 14:10 maxzaselian-okta

Safari 10 uses the safaridriver, which is only supported in Selenium 3. This will be fixed when we upgrade to the latest Selenium.

heathkit avatar Oct 14 '16 01:10 heathkit

We have mapped the protractor to run on Selenium 3.0.1. now we are getting different exception while identifying any element in an application.

Please find the log below. UnsupportedOperationError: Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700' System info: host: 'CDC5-156088275-P.local', ip: '10.145.130.125', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12', java.version: '1.8.0_111' 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}]

Please help us to resolve this.

premkumarvarathan avatar Nov 21 '16 07:11 premkumarvarathan

Is this still an issue? I got this issue when I upgraded safari. Safari version is 10.0.2

So I bumped the version of protractor to the latest: ^5.0.0

Now when I run protractor against safari i get the error:

  0.006s] [safaridriver.client] Connecting to SafariDriver browser extension...
[  0.016s] [safaridriver.client] This will fail if you have not installed the latest SafariDriver extension from
http://selenium-release.storage.googleapis.com/index.html
[  0.017s] [safaridriver.client] Extension logs may be viewed by clicking the Selenium [✓] button on the Safari toolbar

I read that safari has the web driver built in now. Thats why I find this message confusing!

shavo007 avatar Jan 12 '17 06:01 shavo007

@shavo007 You'll get that if you're using Selenium <3.x Protractor 5.0.x still uses 2.53.1 for Selenium Standalone so you'll need to run:

webdriver-manager update --versions.standalone=3.0.1
// then
webdriver-manager start --versions.standalone=3.0.1

pittgoose avatar Jan 19 '17 10:01 pittgoose

@pittgoose @mgiambalvo I updated my webdriver-manager still getting

Error: Error while running testForAngular: undefined is not an object (evaluating 'd.prototype[b].apply') (WARNING: The server did not provide any stacktrace information) [safari #11] Command duration or timeout: 1.37 seconds [safari #11] Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03' [safari #11] System info: host: 'srizvi-mac.local', ip: '10.8.5.147', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.3', java.version: '1.8.0_40' [safari #11] Driver info: org.openqa.selenium.safari.SafariDriver [safari #11] Capabilities [{browserName=safari, takesScreenshot=true, javascriptEnabled=true, version=10.0.3, cssSelectorsEnabled=true, platform=MAC, secureSsl=true}] [safari #11] Session ID: null

running tests in Safari.

irtiza avatar Feb 27 '17 16:02 irtiza

I still haven't gotten this to work myself, but I do know that org.openqa.selenium.safari.SafariDriver is the Selenium distribution of safaridriver and not the one provided my apple.

pittgoose avatar Feb 27 '17 17:02 pittgoose

@pittgoose Tried searching but cannot find the one from Apple.

when I do a launchctl list | grep webdriverd 55528 0 com.apple.webdriverd

I get this. Not sure how to tell webdriver to use this.

irtiza avatar Feb 27 '17 19:02 irtiza

Hi - I could not able to invoke url on safari browser.

1 - Safari is invoked but not navigating to the url

Error : n unknown server-side error occurred while processing the command. (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 142.49 seconds Build info: version: '3.3.0', revision: 'b526bd5', time: '2017-03-07 11:21:31 -0800' System info: host: 'a45e60d691bf', ip: 'fe80:0:0:0:887:8aec:efd2:7cc%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.3', java.version: '1.8.0_112' Driver info: org.openqa.selenium.safari.SafariDriver Capabilities [{applicationCacheEnabled=true, rotatable=false, databaseEnabled=true, handlesAlerts=true, version=12602.4.8, cleanSession=true, platform=MAC, nativeEvents=true, locationContextEnabled=false, webStorageEnabled=true, browserName=safari, javascriptEnabled=true, cssSelectorsEnabled=true}] Session ID: 26E9C288-4C88-4D36-8B64-7FA05353ACD2

Enables Automation on browser and used extension as well.

version using :

/usr/local/lib ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] └── [email protected]

ghost avatar Mar 08 '17 22:03 ghost

Hello,

I am also running into the same exact issue as smunukuntla. The Safari browser will open but then never navigates to my url.

Failed: An unknown server-side error occurred while processing the command. (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 4.37 seconds Build info: version: '3.3.1', revision: '5234b32', time: '2017-03-10 09:04:52 -0800' System info: host: 'ITs-MacBook-Pro.local', ip: 'fe80:0:0:0:9a01:a7ff:feb7:42ad%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.8.0_101' Driver info: org.openqa.selenium.safari.SafariDriver Capabilities [{applicationCacheEnabled=true, rotatable=false, databaseEnabled=true, handlesAlerts=true, version=11602.4.8, cleanSession=true, platform=MAC, nativeEvents=true, locationContextEnabled=false, webStorageEnabled=true, browserName=safari, javascriptEnabled=true, cssSelectorsEnabled=true}] Session ID: 0ACED1F0-D04A-4E0D-9679-6F35DCD4543E

cmacmore avatar Mar 24 '17 18:03 cmacmore