karma-runner / karma-ie-launcher

A Karma plugin. Launcher for Internet Explorer.
MIT License
59 stars 23 forks source link

(Docs) Karma fails to capture Internet Explorer 10 on 64-bit Windows #3

Closed bitwiseman closed 10 years ago

bitwiseman commented 11 years ago

(Copied from https://github.com/karma-runner/karma/issues/429)

Tested using Internet Explorer 10 on Windows 8 64-bit.

This is not a bug in Karma but a limitation of IE and node.js that we need to document.

Repro:

  1. Clean install windows 8
  2. Install node.js 0.8.22
  3. npm install karma - (Testacular)
  4. npm install
  5. Change karma.conf.js to run IE in single-run mode
  6. testacular start karma.conf.js

Expected: karma to launch and capture IE, run tests, exit and close IE

Actual: karma launches IE three times and believes IE has exited each time.

Notes: I believe this is specific to IE 10 64-bit Windows (7 or 8). If anyone else can repro, that would be great.

bitwiseman commented 11 years ago

Workaround/Fix:

  1. Set IE_BIN to "C:\Program Files\Internet Explorer\iexplore.exe".
  2. Add http://localhost to the "Intranet" Zone (or possibly any zone that has "Protected Mode" turned off)

Explanation:

  1. Karma uses %PROGRAMFILES% to locate Internet Explorer. On 32bit OS, this behaves as expected. On a 64-bit Windows with IE 9 (or earlier) this also works - the 32-bit version of IE runs on the 64-bit OS. On 64-bit windows with IE 10+, launching 32-bit IE now causes IE to re-launch a 64-bit process with the same parameters, and exit the 32-bit process with exit code 1. We must instead tell Karma to launch the 64-bit version of IE from the start.
  2. Unsure why this is needed, but it does seem to matter. My current theory is that Protected Mode prevents IE from being a child of another process.
necolas commented 11 years ago

I'm having the same problem with IE 8 on XP.

Latest stable release of Karma and Node.js. I also couldn't get the workaround to resolve the issue.

Since IE was in a VM, I could do some basic testing by running Karma on my Mac and pointing IE 8 to the server on my host machine.

bitwiseman commented 11 years ago

You're running windows XP 64-bit?

necolas commented 11 years ago

You're running windows XP 64-bit?

It's 32-bit.

It's also a VM. But installing everything in the VM and trying to get Karma to run the tests didn't work.

Thanks

bitwiseman commented 11 years ago

@necolas - this issue and the workaround apply only to 64-bit windows 8. Please open a new issue and fully describe your environment, setup, and configuration and delete your comments from this issue.

CoffeeAndCode commented 11 years ago

Only setting the IE_BIN worked for me (Windows 7 from Mac using Parallels using IE 10). I am running as Administrator on the machine which is why I might not have needed the second step.

CoffeeAndCode commented 11 years ago

and just after posting that I ran into an issue with IE trying to stop accessing the url saying it detected an issue. Adding http://localhost to the Intranet sites list does not appear to fix the issue.

The actual error page said:

We were unable to return you to the page you were viewing.

Internet Explorer has stopped trying to restore this website. It appears that the website continues to have a problem.

What you can do:

  Go to your home page  
  Try to return to the page you were viewing  
  More information
    When a website causes a failure or crash, Internet Explorer attempts to restore the site. It stops after two tries to avoid an endless loop.

Choosing to return to the page I was viewing works properly. It might be that IE is trying to access the page too early and is failing because the web server is not up yet. Other browsers appear unaffected.

CoffeeAndCode commented 11 years ago

Co-workers suggestion at disabling Automatic Crash Recovery seems to have helped. It will now restart IE when it encounters an issue and the subsequent launch will attach to the test runner correctly.

http://windows.microsoft.com/en-us/internet-explorer/reopen-previous-session#ie=ie-10

vojtajina commented 10 years ago

Can anybody double-check whether this issue is fixed in 0.1.2 please?

albertosantini commented 10 years ago

It seems ok with 0.1.2 and windows 8 - 64bit without IE_BIN workaround.

Update: anyway it seems IE 10 starts in compatibility mode (IE7). RESOLVED: removed localhost from Tools menu / view compatibility settings.

joeloliver commented 8 years ago

I had the same problem and Its works for me: http://stackoverflow.com/questions/9618774/jenkins-selenium-gui-tests-are-not-visible-on-windows