protractor icon indicating copy to clipboard operation
protractor copied to clipboard

Protractor tests hanging in Chrome after navigating to initial data url

Open diegope opened this issue 12 years ago • 61 comments

After the recent Chrome update I've been having issues getting my specs to run using ChromeDriver. The test execution stalls after trying to navigate to the first data URL. It seems that the URL gets garbled somehow on its way into the browser, as it ends up as: "data:," in the URL field.

Here is the output from the driver:

A Jasmine spec timed out. Resetting the WebDriver Control Flow. The last active task was:

WebDriver.navigate().to(data:text/html,<html></html>)

The chrome driver version is 2.10, and the browser version is 36.0.1985.143

diegope avatar Aug 15 '14 00:08 diegope

WebDriver.navigate().to(data:text/html,<html></html>) is expected because we use this to set up mock modules with angular.

So your set up worked before, and broke by just updating chrome?

hankduan avatar Aug 20 '14 20:08 hankduan

Correct, the URL field was getting set properly prior to the latest chrome update.

I initially noticed a discrepancy between running the tests using the config to specify the location of the chrome driver, and launching the driver manually and specifying the seleniumAddress instead. Launching the driver via config would cause the URL to get set incorrectly, while the manual approach would be more reliable. However, after the last update, neither of these works.

diegope avatar Aug 20 '14 22:08 diegope

Tests are working well on my version of chrome (chromedriver 2.10) and on sauce labs. Is anyone else having an issue?

juliemr avatar Sep 04 '14 20:09 juliemr

Thanks, Julie. I was able to repro this today on another machine, with a fresh installation of Protractor, with the following config:

  • Chrome 36.0.1985.143
  • Protractor 1.2.0
  • Chrome Driver 2.10
  • Windows 8.1 Pro

diegope avatar Sep 05 '14 06:09 diegope

+1 I'm getting data:, as my url instead of http://localhost:8000, I have Chrome 37.x.xxxx Using the latest of everything else.

resistdesign avatar Sep 25 '14 20:09 resistdesign

Hi folks,

Note that navigating to a data url at first is working as intended - tests should then redirect to your page. I think that these issues are something specific to your test setup since we are successfully running tests against Chrome 36 on Travis/SauceLabs.

Could you share your configuration for how you're connecting to ChromeDriver (e.g. using seleniumAddress, chromeonly, etc?)

juliemr avatar Oct 03 '14 22:10 juliemr

I'm getting the same results as the above users.

  • Connecting through seleniumAddress
  • Chrome 37.0.2062.124
  • Protractor 1.3.1
  • Chromedriver 2.10.267517
  • Mac OS X 10.9.4

gamebox avatar Oct 03 '14 22:10 gamebox

Are you getting this issue on something simple (i.e. try step 0 of http://angular.github.io/protractor/#/tutorial)?

hankduan avatar Oct 03 '14 23:10 hankduan

@hankduan I am getting this on an incredibly simple, single spec suite.

gamebox avatar Oct 03 '14 23:10 gamebox

@gamebox I have an identical setup as you (except on OSX 10.9.5). Can you try out the tutorial really quickly to see if you are getting the same thing to just make sure? It should only take <5min. Also what framework are you using?

hankduan avatar Oct 03 '14 23:10 hankduan

I think I made some headway in resolving this. If in my spec, I remove the Protractor by.model() function, it doesn't fail. I noticed that although the data: URL was the visible issue, the test runner was actually telling me the real problem, namely: angular is not defined. This seems like a specific issue in Protractor, does it not @juliemr ?

@hankduan Try removing any by methods from Protractor and see what happens. Keep your spec open, but comment out all of the code in the function body, and just do: expect(true).toBe(true);

That spec will pass, no issue, if my thinking is correct.

gamebox avatar Oct 03 '14 23:10 gamebox

@gamebox check out "Angular can't be found" in the FAQ Are you sure that the variable angular is available on the window?

juliemr avatar Oct 03 '14 23:10 juliemr

@juliemr I hope that the issue for the above isn't the as it was for me. My issue was simply a 404. Protractor's name is cleared. Can I blame this SF heatwave?

gamebox avatar Oct 03 '14 23:10 gamebox

I'm launching it using chromeOnly: true.

In my case it seems that it's somehow related to my development environment. If I launch protractor (from command line, or Visual Studio 2013 nodeJs tools) within our development environment command line, it will always hang on "data:".

However, when launching from a regular command line, or opening the project from the file explorer, everything works fine.

I find this very odd, as I also had this happen on a clean Windows + Visual Studio install with an older version of Protractor - where this particular dev environment wasn't even setup.

diegope avatar Oct 03 '14 23:10 diegope

@gamebox heatwave blamed, carry on :)

@diegope I wonder if this has to do with Protractor starting up a child process (via node's child_process module) which your development environment doesn't like? If you can reproduce in an environment that we can test out please open a new issue, but for now I'm closing this as non-generalizable.

juliemr avatar Oct 03 '14 23:10 juliemr

I am able to repro this on my dev environment. All I did was followed instructions on the tutorial up to step 0 (http://angular.github.io/protractor/#/tutorial). I also got the error here and tried to pass --test-type in chromeOptions args with no luck. Repros both from cmd.exe running as administrator and standard user. When I change the browser to IE, the test is working so it has something to do with the Chrome part.

Protractor - Version 1.3.1 Node - v0.10.31 Chrome - Version 38.0.2125.104 m java version "1.7.0_65" OS: Windows Server 2008 R2 6.1 amd64

@juliemr Should I open a new issue or is there a way to activate this one?

arkulkarni-zz avatar Oct 20 '14 00:10 arkulkarni-zz

We're also running into this issue when running with Chrome Version 38.0.2125.104 m This ONLY fails when running builds via bamboo, although others report issues with team city, jenkins etc. Local runs in dev/build environment when logged on to the windows machine run properly, so this doesn't look to be a protractor issue. I'd like to downgrade my Chrome version, but this doesn't seem to be an option as the installer is no longer available, going to try running with Canary until a fixed Chrome version is released.

Think these two chromedriver Issues are very likely the cause: http://code.google.com/p/chromedriver/issues/detail?id=928 http://code.google.com/p/chromedriver/issues/detail?id=935

gattridge avatar Oct 22 '14 18:10 gattridge

Confirming same issue here with Jenkins on a Win Server, across multiple versions of Protractor. Remoting in and running from the cmd line is fine, but leaving it to Jenkins results in this issue. Good thought on Canary...

j-c-t avatar Oct 23 '14 02:10 j-c-t

same, locally on OSX and on travis

Dakuan avatar Oct 25 '14 16:10 Dakuan

I saw very funny reproduction of this issue today: one app running e2e test just fine and another hanging in connection status. But I figured out quickly enough what was the reason: wrong 'baseUrl' in config ;) And symptoms were exactly as described in this github issue.

e-oz avatar Jan 10 '15 21:01 e-oz