3

I now get "javascript error: circular reference(Session info: chrome=76.0.3809.100)" whenever I try and click on any element on my company's webapp.

This is code that was working fine on previous chromedriver versions

I have tried the solutions mentioned in the "Duplicate" question linked to here, to be honest i think that question was marked duplicate erroneously.

Protractor: Version 6.0.0 (also tried on 5.4.2)

webdriver-manager: using global installed version 12.1.6

Selenium server version: 3.141.59

Node: v10.16.2

and obviously chromedriver_76.0.3809.12

the code i am trying to run is here

async function clickElemByID(strID){
    await browser.sleep(15000);
    var testElem = element(by.id(strID));
    try {
        await testElem.click();//throws "Failed: javascript error: circular reference"
    } catch (e) { 
        console.log(e);
    }
}

the catch block catches:

"JavascriptError: javascript error: circular reference
  (Session info: chrome=76.0.3809.100)
    at Object.throwDecodedError (c:\Users\%username%\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:550:15)
    at parseHttpResponse (c:\Users\%username%\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:560:13)
    at Executor.execute (c:\Users\%username%\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:486:26)
    at process._tickCallback (internal/process/next_tick.js:68:7)Error
    at ElementArrayFinder.applyAction_ (c:\Users\%username%\AppData\Roaming\npm\node_modules\protractor\built\element.js:459:29)
    at ElementArrayFinder.(anonymous function).args [as click] (c:\Users\%username%\AppData\Roaming\npm\node_modules\protractor\built\element.js:97:29)
    at ElementFinder.(anonymous function).args [as click] (c:\Users\%username%\AppData\Roaming\npm\node_modules\protractor\built\element.js:818:22)
    at UserContext.it (c:\Users\%username%\Development\test-automation\Repo\Cloud\UK Tax\HMRC Test Cases 2018-19\hmrcTestCase001\spec01.js:173:28)"

This has happened on multiple machines.

Firefox still appears to be working though

JamesHennigan
  • 100
  • 1
  • 7

4 Answers4

4

As per Issue 2995: javascript error: circular reference with ChromeDriver Its fixed in Chrome/ChromeDriver version 76.0.3809.68 . Please try with 76.0.3809.68.

Change logs :

ChromeDriver 76.0.3809.68
Supports Chrome version 76

Includes the following changes over version 76.0.3809.25:
Fixed a bug in detecting circular reference in JavaScript objects

Edit

There is issue with 'webdriver-manager' its not downloading the latest build of v76.0.0 . You will have to install it yourself issue - 408

npm install chromedriver --chromedriver_version=LATEST
Rahul L
  • 4,249
  • 15
  • 18
  • 2
    THANKS! Installing the newer version was a little harder for me though, it kept defaulting to using the older version used with protractor, even when i dragged the new chromedriver binary into that folder. In the end, i needed to rename chromedriver_76.0.3809.68.exe to be chromedriver_76.0.3809.12.exe to, for lack of a better word, trick it into using the newer one. "8 Specs, 0 Failures", sight for sore eyes – JamesHennigan Aug 14 '19 at 13:21
0

I am also facing the same problem.

According to my research, this happened from ChromeDriver version 75.0.3770.8. https://sites.google.com/a/chromium.org/chromedriver/downloads

ChromeDriver 75.0.3770.8

Supports Chrome version 75

The most noticeable change is ChromeDriver now runs in W3C standard compliant mode by default.

This means, they have enabled W3C standard in the chrome driver. To fix this, either the circular reference error need to be fixed in code or disable W3C. For some disabling W3C worked with the solution from github issue: https://github.com/angular/protractor/issues/5261

capabilities: {
  'goog:chromeOptions': {
  w3c: false
  }
}

Unfortunately, this solution is not working for me. You can try this as a temporary solution.

Sudharsan G
  • 51
  • 1
  • 1
  • 3
0

Looks like someone has fixed this in webdriver-manager but it hasn't been released yet. I had the same issue and was able to fix it by applying this diff to my local version of webdriver-manager in node_modules: https://github.com/angular/webdriver-manager/pull/413/commits/6a95aa4187825d1293bda7c802f39257699095fc

Then updating webdriver downloaded the latest version and everything worked.

anjhinz
  • 41
  • 3
0

As mentioned by others there is a issue with 'webdriver-manager' its not downloading the latest build of v76.0.0 . even-though you specify the exact version by giving webdriver-manager update --versions.chrome 76.0.3809.68 it always points to the chrome 76.0.3809.12. only name is changed but the file has chrome 76.0.3809.12 version only i think

and as mentioned by Rahul L

quick fix : install chromedriver through npm - v76.0.1

https://www.npmjs.com/package/chromedriver

but one catch here is protractor always points to the default chromedriver that comes along with the webdriver-manager update ,hence just adding the package alone is not enough ,we have to add some values in the config file to over come this senario , we have to overwrite the chromedriver reference path through the config file with these values

export.Config = {
      DirectConnet:true,
      chromeDriver: process.cwd()+'/node_modules/chromedriver/lib/chromedriver/chromedriver.exe',
subramanian
  • 1,125
  • 1
  • 12
  • 12