Debugging tests in Internet Explorer with Visual Studio.

153 views
Skip to first unread message

Paul B.

unread,
Dec 28, 2012, 4:23:46 AM12/28/12
to js-test...@googlegroups.com
Hello,

I am a fairly new user of JsTestDriver. In my company I'm trying to turn our JS implementations to unit testing for future developments and I'm using JsTestDriver. I'm very pleased with the result but have a two main questions.
Let me present my environment : Windows XP/IE7. Yes I need to test under IE7/IE8 (Not Firefox, nor Chrome)..

- My first question is about using Visual Studio's debugger (attached to IE) during the tests. It's working fine, the ony problem is once VS captured a breakpoint, the ongoing test fails because of a BrowserPanicException. I understand that when VS is blocked on a breakpoint, IE is blocked and therefore raises a BrowserPanicException for the running test. Is there any work around to avoid this exception, finish debugging and display the test result ?

- Second and certainly more important. Running a single test in IE7 lasts aroung 30sec, is it normal? (there is approx. 35 javascript files w/ average of 500lines of code per file loaded)


Thanks,
Paul

Cory Smith

unread,
Dec 28, 2012, 7:14:26 AM12/28/12
to js-test...@googlegroups.com
1. Setting --browserTimeout=-1 should disable the timeout. Let me know
if it doesn't.
2. No. *facepalm* Unfortunately, I do not have access to an IE
instance for testing and debugging. How long does a simple hello world
take?
> --
> You received this message because you are subscribed to the Google Groups
> "JsTestDriver" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/js-test-driver/-/9kkBZzSkVjQJ.
> To post to this group, send email to js-test...@googlegroups.com.
> To unsubscribe from this group, send email to
> js-test-drive...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/js-test-driver?hl=en.

Paul B.

unread,
Dec 28, 2012, 8:36:03 AM12/28/12
to js-test...@googlegroups.com
Thanks Cory for pointing out the --browserTimeout option, it works BUT I just get a strange behavior.
I can debug but not for too long. If I stay too long debugging in Visual Studio, JSTD throws the BrowserPanicException..

See my log : 
Dec 28, 2012 2:16:43 PM com.google.jstestdriver.JsTestDriverModule configure
FINE: Configured with:
flags:FlagsImpl [port=-1,
 sslPort=-1,
 server=null,
 testOutput=,
 browser=[],
 reset=false,
 browserTimeout=-1,
 config=DefaultConfigurationSource [name=jsTestDriver.conf],
 tests=[TestHelloWorld],
 displayHelp=false,
 verbose=false,
 captureConsole=false,
 preloadFiles=false,
 dryRunFor=[],
 arguments=[],
 runnerMode=QUIET,
 requiredBrowsers=null,
 serverHandlerPrefix=com.google.jstestdriver.model.NullPathPrefix@1912839
 raiseOnFailure=false]
... 
testSuiteTimeout:7200  (Maybe because of this? How can I change it?)
...

the end of the log:

Dec 28, 2012 2:16:43 PM com.google.jstestdriver.CommandTask run
FINE: Starting {"command":"runTests","parameters":["[\"TestHelloWorld\"]","false","1"]} for 1356700520226
Dec 28, 2012 2:17:13 PM com.google.jstestdriver.CommandTask run
FINE: finished {"command":"runTests","parameters":["[\"TestHelloWorld\"]","false","1"]} for 1356700520226
Dec 28, 2012 2:17:13 PM com.google.jstestdriver.browser.BrowserActionExecutorAction run
FINE: Finished BrowserActions [com.google.jstestdriver.RunTestsAction@c9ab5a].
Dec 28, 2012 2:17:13 PM com.google.jstestdriver.ActionRunner runActions
INFO: Finished com.google.jstestdriver.browser.BrowserActionExecutorAction@73dd96
Dec 28, 2012 2:17:13 PM com.google.jstestdriver.ActionRunner runActions
INFO:
Dec 28, 2012 2:17:13 PM com.google.jstestdriver.Main main
FINE: Error {}
Failures during test run.
Caused by:
com.google.jstestdriver.browser.BrowserPanicException: Browser Microsoft Internet Explorer 7.0 Windows
During {"browserInfo":{"id":1356700520226,"name":"Microsoft Internet Explorer","version":"7.0","os":"Windows","uploadSize":50,"serverReceivedHeartbeat":true,"ready":true},"cause":"Browser unresponsive since 2012-12-28T13:16:43.399Z during command\u003d {\"command\":\"runTests\",\"parameters\":[\"[\\\"TestHelloWorld\\\"]\",\"false\",\"1\"]}"}
        at com.google.jstestdriver.CommandTask.run(CommandTask.java:136)
        at com.google.jstestdriver.JsTestDriverClientImpl.sendCommand(JsTestDriverClientImpl.java:103)
        at com.google.jstestdriver.JsTestDriverClientImpl.runTests(JsTestDriverClientImpl.java:141)
        at com.google.jstestdriver.RunTestsAction.run(RunTestsAction.java:71)
        at com.google.jstestdriver.browser.BrowserActionRunner.call(BrowserActionRunner.java:70)
        at com.google.jstestdriver.browser.BrowserActionRunner.call(BrowserActionRunner.java:37)
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

        at com.google.jstestdriver.browser.BrowserActionExecutorAction.run(BrowserActionExecutorAction.java:154)
        at com.google.jstestdriver.ActionRunner.runActions(ActionRunner.java:81)
        at com.google.jstestdriver.embedded.JsTestDriverImpl.runConfigurationWithFlags(JsTestDriverImpl.java:342)
        at com.google.jstestdriver.embedded.JsTestDriverImpl.runConfiguration(JsTestDriverImpl.java:233)
        at com.google.jstestdriver.Main.main(Main.java:70)


I don't understand why there is 30seconds between the starting and finished of the run command. And the last log : Dec 28, 2012 2:17:13 PM com.google.jstestdriver.Main main FINE: Error {}


Any idea?

Paul B.

unread,
Jan 10, 2013, 10:40:05 AM1/10/13
to js-test...@googlegroups.com
I figured out the problem.

In my previous message I forgot to mention the previous Logs where a SEVERE error occured while uploading the scripts files to the browser. 
I realized that I kept Visual Studio's debugger plugged to Internet Explorer all the time, but it seems that when you run a test the first time (or if you changed your JS scr files) JsTestDriver uploads all the files again. And it is during this step that I kept having an error because of Visual Studio's debugger plugged.. 

My work around for now is to run the test without the debugger (to have the files loaded in the browser) THEN plug the debugger and re-run the test.

Hope it can help someone for the future!

Paul B.

unread,
Jan 15, 2013, 10:39:21 AM1/15/13
to js-test...@googlegroups.com
Can be related to this issue as well:
Reply all
Reply to author
Forward
0 new messages