Open bitwiseman opened 11 years ago
Moving discussion from #3:
@pouncilt said:
Well I am having the same capturing problem; but I am using VMWare Fusion to launch IE from my mac. I added the > http://localhost into my intranet zone for IE, and turned protected mode off in IE. The one good thing that came from doing this is now Karma only launches IE once instead of 3 or more times. Karma is able to run my test before crashing.
Setting the IE_BIN variable doesn't help me because IE is not on my local file system; but rather on my virtual machine. How do I get Karma to stop crashing when I test IE in a virtual machine? I wonder how might I solve this problem? Any ideas? BTW: my virtual machine is running Windows 7 32-bit OS and IE8.
@pouncilt - What you're describing sounds like a very odd usage scenario. If you're trying to launch IE on a windows vm from an instance of Karma running on the host mac system, there is going to be some interesting acrobatics occurring to make this happen.
Are you running Karma from a windows cmd shell? Have you tried this in non-Fusion mode running Karma inside the windows VM?
@pouncilt said:
@bitwiseman - I am running Karma from my mac terminal.
As you may or may not now already is that macs can not run an IE browser so that is why I am using vmware fusion; so I can use IE from my mac.
I am curious to know if you get the same error message as I do: ERROR [launcher]: [BROWSER NAME HERE] crashed? In my case the actual error message is: ERROR [launcher]: src/test/scripts/ie8.sh crashed.
This might be the same issue, if you get the same message; because I cannot set the IE_BIN variable Karma doesn't know the correct IE path.
@pouncilt - (Feel free to delete you response from the other issue (as I did with mine). I understand what VMWare Fusion is, I often run on a mac as well, but I do not run in Fusion mode - I like my Windows VM to be all in one window.
You are correct, this issue is similar #3, but these really are different issues.
The root cause for the other issue is a combination of running on widows 8 64-bit and karma trying to launch 32-bit IE. The root cause for this issue is running karma from a mac console to launch IE using VMWare Fusion.
Because of this, the workaround listed in the other issue will not fix this issue. My best guess at a workaround for this issue is completely different from #3.
Please try the following:
node --version
- should show "v0.10.12"mkdir karma-test; cd karma-test
karma-test
foldernpm install
karma start
is done from the cmd window. I believe this will work (assuming your project can run on windows), but it may not. Please tell me your results.
The original scripts that was used to get all this working can be found here: https://github.com/angular/ci.angularjs.org/tree/master/bin. I downloaded the ie8.sh and i.e_.sh files. I ran into problems running the ie8.sh because it could not resolve the location to the i.esh file via the ". i.e.sh" at the end of the file. So I added the absolute directory in front of the i.e.sh file name and I renamed the i.e.sh file to i.e.sh and I updated the ie8.sh file to: [Start of the ie8.sh file]
SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
VMNAME="Win7_IE8" VMPATH="/Users/pouncilt/documents/Virtual Machines.localized/Win7_IE8.vmwarevm/Win7_IE8.vmx" LOG_FILE="/Users/pouncilt/Development/software/virtual-machine/ie8.log"
. $DIR/ie.sh [End of ie8.sh file]
[Start of i.e_.sh file]
export PATH="/Applications/VMware Fusion.app/Contents/Library/":$PATH
winExec() { if [[ "$VMPATH" == XP ]]; then vmrun -T fusion -gu misko -gp heslo runScriptInGuest "$VMPATH" "" "cmd.exe /c \"$1\" $2 $3 $4" >> $LOG_FILE 2>&1 else vmrun -T fusion -gu misko -gp heslo runProgramInGuest "$VMPATH" -activeWindow -interactive "$1" $2 $3 $4 >> $LOG_FILE 2>&1 fi }
killIe() { winExec C:\Windows\system32\taskkill.exe /IM iexplore.exe /F }
trap "killIe; exit 0" EXIT
echo -e "\n\n\n----------------+ date
+----------------\n" >> $LOG_FILE
captureUrl=$1 winExec "C:\Program Files\Internet Explorer\iexplore.exe" ${captureUrl/localhost/[YOUR MAC IP ADDRESS HERE]} [End of i.e_.sh]
Here are the steps to install and run IE8 from mac:
export PATH="/Applications/VMware Fusion.app/Contents/Library/":$PATH
winExec() { if [[ "$VMPATH" == XP ]]; then vmrun -T fusion -gu IEUser -gp Password1 runScriptInGuest "$VMPATH" "" "cmd.exe /c \"$1\" $2 $3 $4" >> $LOG_FILE 2>&1 else vmrun -T fusion -gu IEUser -gp Password1 runScriptInGuest "$VMPATH" -activeWindow -interactive "" "cscript.exe \"$1\" $2" >> $LOG_FILE 2>&1 fi sleep 3 }
winExecute() { if [[ "$VMPATH" == XP ]]; then vmrun -T fusion -gu IEUser -gp Password1 runScriptInGuest "$VMPATH" "" "cmd.exe /c \"$1\" $2 $3 $4" >> $LOG_FILE 2>&1 else vmrun -T fusion -gu IEUser -gp Password1 runProgramInGuest "$VMPATH" -activeWindow -interactive "$1" $2 $3 $4 >> $LOG_FILE 2>&1 fi }
killIe() { winExecute C:\Windows\system32\taskkill.exe /IM iexplore.exe /F }
trap "killIe; exit 0" EXIT
echo -e "\n\n\n----------------+ date
+----------------\n" >> $LOG_FILE
captureUrl=$1
winExec "C:\Users\IEUser\startie.vbs" ${captureUrl/localhost/[Mac IP Address Here]}
WshShell.Run strIE & " " & objArgs(0) [End of startie.vbs file]
So I don't know why Karma keeps crashing. Any help to resolve this would be deeply appreciated.
Thank you.
Thanks. It looks like the ie_.sh should be creating a log file. If so, what's in that log file?
In your last step you said, that IE8 launches and runs all your tests and then reports a crash at the end of the the run. Did I read that correctly?
In your first update of ie_.sh
to ie.sh
, I understand your change. I'm not sure I understand the second one. I see you needed to change the IP address, but you made further modifications by adding winExecute() and running through that sometimes. ... I see there was a %22
being added which translates to a "
being added at the front of the URL.
What about the work around steps I suggested? I know they are not a viable option long term, but then you would at least have runable state while we figure this out.
The VMWare Fusion logs go in there. For example if you have the wrong user name and password, VMWare Fusion will log this error in the log file. Or if you try to start Karma before you start VMWare Fusion, VMWare Fusion will tell you that the VM has not been started.
Yes, you read me correctly - IE8 successfully launches and runs all my Jasmine test successfully and then Karma crashes once all the test have rand. When you start Karma in continuous integration mode it is supposed to stay running and connected to the browsers, and re-run the Jasmine tests if and when the code changes.
WinExecute() method is actually the original method. The only thing that is different from the original method is the name "winExecute()". I needed to keep the original winExecute() method in order to properly kill the browsers regardless if the browsers are running on VM or locally and whether or not the browsers are IE, FF, Chrome, or Safari. You will notice that the winExecute() method is only called from the killIe() method. In addition to this, you should notice that I changed the winExec() method in the else block to run the csscript.exe and that this winExec() method is only called at the end of the script; which is where I pass in the VBscript and Karma URL.
In addition to seeing that the %22 being added to the beginning of the URL, you should also see an actual double quote at the of the URL. At least, that is what I am seeing.
I didn't try the work around you suggest because I am able to start the IE8 browser in the VM and run my tests. Until this issue is resolved, I will just have to keep killing Karma server after each test run because Karma thinks that the browser has crashed. In reality the browser doesn't really crash. The script receives an exit 0 code and calls the killIe() method. If I comment out the trap statement the browser would still be open.
I am glad that you are taking a look at this. I really appreciate this. Let me know if you were able to follow my steps to reproduce this issue. If you are able to reproduce, are you seeing the same things I am seeing? You can get a 30 day trail version of VMWare Fusion to test with.
Thank you.
Can anybody double-check whether this issue is fixed in 0.1.2 please?
(similar repro steps to https://github.com/karma-runner/karma-ie-launcher/issues/3 ).
Repro:
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.
Windows version can be 32-bit or 64-bit, can be window xp or greater.