protractor icon indicating copy to clipboard operation
protractor copied to clipboard

Getting "Error: Error while running testForAngular: JavaScript error in async script..." only on IE9+ X64 when using browser.get(urlVariable);

Open tracycummins opened this issue 13 years ago • 5 comments

Hello,

I have a simple protractor test as follows: describe('Home Page', function() { var url; it('should load the homepage', function() { url = 'samdev/poc/#'; browser.get(url); var home = element(by.id('header-project')); expect(home.getInnerHtml()).toBe('Manager'); }); }); I'm using a windows 7 system and using IEDriverServer.exe (from IEDriverServer_x64_2.37.0.zip).

Whenever I run protractor (via grunt-protractor-runner), I get the following error: " Stacktrace: Error: Error while running testForAngular: JavaScript error in async script. (WARNING: The server did not provide a ny stacktrace information) Command duration or timeout: 49 milliseconds Build info: version: '2.37.0', revision: 'a7c61cb', time: '2013-10-18 17:14:00' System info: host: 'TRACYT-PC', ip: '10.112.4.136', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.vers ion: '1.7.0_05' Session ID: 29599c2f-6272-4619-a103-11e06fdbca47 Driver info: org.openqa.selenium.ie.InternetExplorerDriver Capabilities [{platform=WINDOWS, javascriptEnabled=true, elementScrollBehavior=0, enablePersistentHover=true, ignoreZoom Setting=false, ie.ensureCleanSession=false, browserName=internet explorer, enableElementCacheCleanup=true, unexpectedAle rtBehaviour=dismiss, version=10, ie.usePerProcessProxy=false, cssSelectorsEnabled=true, ignoreProtectedModeSettings=fals e, requireWindowFocus=false, initialBrowserUrl=http://localhost:43706/, handlesAlerts=true, ie.forceCreateProcessApi=fal..."

I am using the latest protractor version (0.12.1) and standalone selenium server 2.37.0.

If I change to use 32 bit IEDriverServer.exe and it is fine. I have no problem running the above test in chrome and firefox. If I put in "browser.get('samdev/poc/#');" directly instead of a variable then it is fine as well.

Can you please assist?

tracycummins avatar Nov 13 '13 16:11 tracycummins

Are you sure you're using the same quotes and everything when you do browser.get with a variable versus with a string?

juliemr avatar Nov 13 '13 20:11 juliemr

@juliemr I have figured out what is happening. It is not because of variable being used versus a string. Yes, I did use same quotes and everything.

Sorry for the long story below but I have to list what I did: I did multiple trials and errors and saw that I don't see the issue when I run the test the first time. When I restart the test the error occurs again. Then I rebooted my system and see that the test run fine again the first time and error out on every restart.

Then I restart my web server which is a jetty service running on my local machine. That is the web app I have been trying to test all these time. After the restart, the test runs fine again. Next I tried using your example testing against angularjs and the test runs fine every time.

Conclusion: there is something holding up or wrong in my web server causing the problem where protractor doesn't get the right status so test returned failed.

I think we are good to close out this issue if you want to. I'll try to debug from another perspective now. Actually, it is really weird that only IE 64bit having issues. Also, I have no clue what is going on when looking at the error stack trace.

Thanks for your time.

tracycummins avatar Nov 14 '13 17:11 tracycummins

OK, good luck, and please let us know when you figure it out!

juliemr avatar Nov 14 '13 18:11 juliemr

I am also running into this problem on IE. The very strange part is that the failures appear to be random. I have seen the suite of tests completely pass but in other times I get the following error:

Error: the string "Error while running testForAngular: JavaScript error in async script. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 47 milliseconds

It seems to be the same issue described in this StackOverflow quesiton. The failures happen during different parts of the test and inconsistently.

@tracycummins - did you determine what was causing this on your side?

teddyhwang avatar Dec 20 '13 16:12 teddyhwang

I'm still getting this today while testing GlobaLeaks on edge on saucelabs:

Error while running testForAngular: not implemented (WARNING: The server did not provide any stacktrace information)

the error happens only on edge while as you can see all works great for every other browser/version: https://saucelabs.com/u/globaleaks

here is the travisCI output that may help in analyzing the issue: https://travis-ci.org/globaleaks/GlobaLeaks/jobs/93326914

evilaliv3 avatar Nov 26 '15 11:11 evilaliv3