Skip to content
This repository has been archived by the owner. It is now read-only.

Firefox 35: Passing arguments to executeScript isn't working #8390

Closed
lukeis opened this issue Mar 4, 2016 · 48 comments
Closed

Firefox 35: Passing arguments to executeScript isn't working #8390

lukeis opened this issue Mar 4, 2016 · 48 comments

Comments

@lukeis
Copy link
Member

@lukeis lukeis commented Mar 4, 2016

Originally reported on Google Code with ID 8390

With Firefox 35, passing arguments to executeScript is not working like it used to:

Expected behaviour:

>> d.execute_script("return typeof arguments[0]", "foo")
=> "string"

Actual behaviour

>> d.execute_script("return typeof arguments[0]", "foo")
=> "undefined"


Reported by jari.bakken on 2015-01-15 13:57:18

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

Console warning:

Security wrapper denied access to property length on privileged Javascript object.
Support for exposing privileged objects to untrusted content via __exposedProps__ is
being gradually removed - use WebIDL bindings or Components.utils.cloneInto instead.
Note that only the first denied property access from a given global object will be
reported.

Reported by jari.bakken on 2015-01-15 14:14:29

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

I don't have time to dig into this further right now, but here's what I've found so
far:

The warning message suggests we use Components.utils.cloneInto with a Sandbox. Currently
we only use a sandbox if the document is in designMode, and then async script execution
is "not supported". 

Marionette appears to implement executeAsyncScript with a Sandbox, so it's likely possible.

https://dxr.mozilla.org/mozilla-central/source/testing/marionette/marionette-listener.js?from=marionette-listener.js&case=true#528

We could ignore executeAsyncScript for now and just force the sandbox code path for
Firefox 35, i.e.:

  https://gist.github.com/jarib/6a19bd42d2f90c9055b3

However this breaks a few tests: we're no longer able to call functions that are already
defined on the page through executeScript.

Reported by jari.bakken on 2015-01-15 15:13:11

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

Reported by jari.bakken on 2015-01-15 15:13:50

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

I can replicate this behaviour on OSX 10. 9.5 and Ubuntu using the selenium-webdriver
gem (2.44.0) and Firefox 35.0. Reverting firefox to 34.0 as downloaded from https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/34.0/mac/en-US/
resolves the issue.

The issue is trigged with calls to Capybara::Selenium::Node#set on an <input> field

Reported by chris.atkins@lonelyplanet.com.au on 2015-01-16 02:46:12

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

Issue 8389 has been merged into this issue.

Reported by jmleyba on 2015-01-16 03:26:00

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

Issue 8398 has been merged into this issue.

Reported by jmleyba on 2015-01-16 20:16:16

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

Issue 8387 has been merged into this issue.

Reported by jmleyba on 2015-01-16 20:17:06

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

Issue 8393 has been merged into this issue.

Reported by barancev on 2015-01-17 21:02:48

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

I also tried working around this by just JSON-serializing the args object, but quickly
realized that it would mean WebElement arguments would no longer work:

  https://gist.github.com/jarib/89406c5c5c019b72cd7c

Perhaps someone has better ideas?

Reported by jari.bakken on 2015-01-17 21:47:12

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

Maybe parse the args and swap out webelement references for css selectors that you could
deference on the page side? That's basically what we do in Safari.

Reported by jmleyba on 2015-01-18 19:43:24

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

I see this on Ubuntu 14.04 (x86_64) with selenium-webdriver gem 2.44.0 and Firefox 35.0,
and that Firefox 34.0.5 solves the problem.

Reported by derrelldurrett on 2015-01-18 20:37:49

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

Thanks, but this is caused by a change in FF35 and will impact that browser on all platforms.

Reported by jmleyba on 2015-01-18 20:53:06

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

Waiting for resolution, I confirm rolling back to a previous Firefox version (ex. 33.1)
makes selenium driver 2.44.0 usable again.
(OS : Ubuntu 14.04 x64)

Reported by dvdngrllo on 2015-01-19 15:44:02

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

Issue 8325 has been merged into this issue.

Reported by barancev on 2015-01-20 06:47:54

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

Issue 8416 has been merged into this issue.

Reported by james.h.evans.jr on 2015-01-21 15:40:24

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

Issue 8418 has been merged into this issue.

Reported by jmleyba on 2015-01-21 19:47:07

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

Hey, jari.bakken.  Thanks for looking into this.  I wanted to let you know that if you
fix it, my team and I would be happy to buy you some beers or coffees if that is your
style.

Reported by gerryster on 2015-01-22 19:12:54

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

Workaround: Use the XPath locator for the web element and trigger a plain JavaScript
invocation.

See http://stackoverflow.com/questions/10596417

Reported by jan.mewes@epages.com on 2015-01-23 16:29:51

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

jari.bakken, you need to change only 2 lines of code inside firefoxDriver.js:
https://gist.github.com/Kimosabe/9ad899c3ca630026e3b5

Tried to apply this changes to script inside wibdriver.xpi of selenium v44. Works fine
with firefox 35.

Reported by 4B.69.6D.6F on 2015-01-27 08:53:12

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

Can you detail the change you made to the webdriver.xpi of sel v44. Need to get this
fixed asap. Thanks so much!

Reported by Chapman.Chris.H on 2015-01-27 17:29:36

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

This issue was closed by revision 66d55c84463d.

Reported by jmleyba on 2015-01-28 00:24:26

  • Status changed: Fixed
@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

Any plans on rolling out a new Selenium release, available in Maven Central?

Reported by yamert on 2015-01-28 16:30:53

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

Is there also a pre-release or a snapshot version of selenium-java artifact available
in maven repo?

Reported by bernard.i.lago on 2015-02-04 02:25:51

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

wow, that was fast. Many thanks, everything works perfectly now. :)

Reported by pfrasa on 2015-02-04 09:37:35

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

Am also very interested in a pre-release or a snapshot version of selenium-java artifact!

Reported by christian.zangerl on 2015-02-04 10:14:21

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

This is a blocker for us as well. +1 for Java maven release.

Reported by AdamJasonDev on 2015-02-04 15:21:44

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

When will a stable release come out with this fix?

Reported by akbardhedhi on 2015-02-04 15:46:49

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

Great work, and excellent response time here guys. Was wondering when the pre-release
for this will be out on nuget?

Reported by rankin.dc on 2015-02-04 15:57:33

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

As a user of protractor, I'd like to try this fix out. How can I install the latest
version of selenium-webdriver?

Thanks for the quick turnaround on this.

Reported by andrew.eisenberg on 2015-02-05 22:43:10

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

I am using the python version of Selenium. is there any quick fix for it?

Reported by yizhongji on 2015-02-06 20:16:38

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

FYI I have built my own version for dot net - see https://code.google.com/p/selenium/wiki/ReleasingSelenium

Reported by david.rankin@norlandtech.com on 2015-02-09 14:56:06

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

Issue 8477 has been merged into this issue.

Reported by jmleyba on 2015-02-10 17:04:40

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

@David, Could you please provide me the DLLs, where this issue is fixed. It will be
very helpful.

Reported by Gurudatt.gd04 on 2015-02-16 12:17:49

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

Have anyone resolved this issue without downgrading firefox? If so please share your
insight on the same.

Reported by nirmalspecial on 2015-02-17 06:03:01

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

"Release is still blocked on fixing native events for FF35."

Any update on this? FF36 will be out soon. Shouldn't these sort of things be resolved
in advance of stable releases of Firefox? Isn't that the whole purpose of Mozilla having
aurora/beta releases available months in advance?

Reported by treguard0439 on 2015-02-17 10:04:56

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

Do we have a timeline on a release, yet?

Reported by qtrolazyg on 2015-02-19 16:40:17

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

@GURUDATT
Attached are the files. Hopefully they help. if you have problems contact me directly,
I only saw this message recently.

David

Reported by rankin.dc on 2015-02-23 12:48:50


- _Attachment: [SELENIUM_DLLS.zip](https://storage.googleapis.com/google-code-attachments/selenium/issue-8390/comment-41/SELENIUM_DLLS.zip)_
@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

Is there anyway to patch this issue in the current build? Our manual test team just
found a regression in Firefox 35 that would have been caught by our automated tests
weeks ago if we could update. It seems like this is a major blocker for some folks.

Reported by AdamJasonDev on 2015-02-23 21:08:49

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

 @AdamJaso...@gmail.com  There is another conversation about similar issues (FF 36),
issue 8399.  There they talk about a dev version that is available.

Reported by qtrolazyg on 2015-02-25 20:10:06

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

Is this Javascript issue in firefox 35 fixed in selenium latest version or any patches
released for this fix. Please let me know.

Reported by rameshnss on 2015-02-26 16:30:07

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

selenium 2.45 is out and works well with FF release (36)

Reported by qtrolazyg on 2015-03-01 00:23:03

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

I upgraded FF to 36 and Selenium to 2.45. In command with Javascript I got error  <Exception
Found: org.openqa.selenium.WebDriverException: Error: Syntax error, unrecognized expression:
By.cssSelector: .email_addresses_tipsy

for FF 35 and Selenium to 2.44 - this error is not appear in my tests

Reported by Antinua888 on 2015-03-05 23:26:47

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

> selenium 2.45 is out and works well with FF release (36)

Not really... https://code.google.com/p/selenium/issues/detail?id=8551

Reported by steven.mcphillips@lonelyplanet.com.au on 2015-03-05 23:40:16

@lukeis

This comment has been minimized.

Copy link
Member Author

@lukeis lukeis commented Mar 4, 2016

Reported by luke.semerau on 2015-09-17 18:25:06

  • Labels added: Restrict-AddIssueComment-Commit
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.