selenium: Firefox 59 fails to return dom elements

  • OS: OSX
  • Selenium Version: 3.11.0 through protractor
  • Browser: Firefox 59
  • geckodriver-v0.20.0

since the latest firefox version (59) doing a POST /execute call that returns a DOM element fails with the following:

Failed: TypeError: cyclic object value
    Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:33:15.31Z'
    System info: xxx os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.3', java.version: '1.8.0_74'
    Driver info: driver.version: unknown

all other browsers, including firefox 58 don’t have problems with this. I suppose that this happens because it tries to serialize an object with cyclical references.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 9
  • Comments: 48 (28 by maintainers)

Most upvoted comments

Ok, I’m now able to reproduce. All future updates will be visible in the above mentioned bug. I will close this issue when the problem has been fixed.

I am seeing the same issue in a similar situation - getting elements with protractor on a react page. The problematic method in my code appears to be By.cssContainingText - looks like this is returning an array and iterating over each element to check if it contains the given text. I get the same cyclic object value error when running my tests, but I don’t have the opportunity to use the [0] fix mentioned by @itajaja since the array is never directly exposed to me in my code.

Example (on a page running react, in Firefox 59): element(By.cssContainingText('button', 'click me')).click()

@itajaja Thank you! The issue can be reproduced on this site.

No, the bug hasn’t been fixed yet. But I’m currently looking into it.

Ran into the same issue but thought the problem was somewhere else as I have seen similar problems on Edge or IE11. Related to https://github.com/w3c/webdriver/issues/1241 and https://github.com/webcomponents/shadydom/issues/217

My testing indicates that Firefox 58.0.2 works, 59.0b3 and newer do not.

The only workaround I have found so far is to override the JSON serialization of the problematic element properties, e.g. element[key].toJSON = function(){return;}

Both FF 59 (release) and FF 61 (nightly) suffer of this issue.

@barancev I’m confused why you say you’re testing against Firefox 61 when the issue description, and all examples, say Firefox 59. If FF 61 isn’t broken it might be safe to assume that they’ve already fixed this issue in subsequent builds, but I am also seeing this issue in FF 59.