Protractor: data:text/html,<html></html>

Created on 21 Dec 2018  路  13Comments  路  Source: angular/protractor

This is a very difficult issue to reproduce. Running protractor 5.4.1, and Chrome Version 71.0.3578.98 (Official Build) (64-bit).

When the tests are running (NOT in headless mode, they work fine in that mode), all of a sudden the test browser and the tests stop completely and the URL of the page in the browser is "data:text/html,". It just hangs at this point. If I press enter on the URL, everything proceeds as if there was never a problem and the tests pass! It happens at random points in the tests so I can't reproduce it.

The tests are running against a nodejs server. Any ideas?

All 13 comments

I also encountered this issue. I can't reproduce it manually. I could only find the issue in my automation by video recording.

I wonder if this has something to do with the bootstrap process. This is important for AngularJS applications. Probably the async execute is not returning? Unfortunately, I do not have bandwidth to investigate this issue.

Maybe there is a XHR request still "pending" in the background? You can check that out by opening the Chrome Dev Tools -> Network Tab and see if there is a request marked as "pending" when you encounter the error. Note that you'll have to open the dev tools before the error shows up.

Any updates?

I do not have anything new here. Could it be a Chromedriver Chrome version mismatch? I have not seen this yet.

So this bug appears very randomly. When the tests are running and a new page is loading / the test is navigating to a new page, the browser / test seems to loading the reset url and just stops executing. The tests do not abort.
I couldn't manage to find the exact problem. As I said, it is very random but I've encountered this bug quite often. I am not able to create a mcve. I guess I solved this issue by increasing some timeouts and adding some await browser.sleep(5000); (ie after navigation or refresh commands).
Some people suggested to pass a few arguments to Chrome as mentioned in this SO post. These doesn't solve it, I am using none argument right now (and it kind of works now). I just passed unexpectedAlertBehaviour: 'accept' to the capabilities object, but I am not sure if that is related to this problem.

I'll update this if I find out more.

I am also seeing this issue using Angular 7 on windows with protractor. This is behavior for me. I seem to be getting similar problems in headless mode on unix too.

This post talks about the data:text/html being a default reset url in protractor. I believe this is a protractor bug.

https://stackoverflow.com/questions/24824491/opening-a-file-with-protractor

i got the same problem.
hangs sometimes on data:text/html,
chromedriver_2.46.exe
protractor 5.4.2

I have the same issue and I haven't been able to find a workaround for this.

Seeing the same issue on a nodejs server when testing with ChromeDriver 73.0.3683.68 and protractor 5.4.2.

Seeing this issue with a local node js server and a external URL now; It's leading to a great deal of flaky tests. If I am running the tests locally I can hit enter on the URL containing, data:text/html,<html></html> and the tests continue to execute correctly; however, if I don't hit enter on this URL all the remaining tests in the suite fail with the errors:

- Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.

- Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.

We are running into this in an internal Google test.

Hi,
Do you try to get url below?
browser.get('https://www.google.com/');
Try this one;
browser.driver.get('https://www.google.com/')

Hi :

Yes it worked for me , currently i have cucumber set up

Was this page helpful?
0 / 5 - 0 ratings