Fatal error: Cannot read property %browser.id% of null
See original GitHub issueError happens if browser failed on start. Simplest case is when test case contained a Syntax Error. Here is the example, run grunt
to se the issue.
It is rather Karma problem, because onBrowserComplete
is triggered twice and suites
is null
’ed by the second call. Here is some debugging output:
--> onRunStart
INFO [karma]: Karma v0.12.12 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 34.0.1847 (Mac OS X 10.9.2)]: Connected on socket zY0n_4LMncgG3V6ETzU9 with id 87250253
Chrome 34.0.1847 (Mac OS X 10.9.2) ERROR
Uncaught SyntaxError: Unexpected end of input
at /Users/siavorskyi/projects/CD/karma-junit-reporter-failure/test/syntax-error.spec.js:4
Chrome 34.0.1847 (Mac OS X 10.9.2): Executed 0 of 0 SUCCESS (0 secs / 0 secs)
--> onBrowserStart 87250253
--> initliazeXmlForBrowser
Chrome 34.0.1847 (Mac OS X 10.9.2): Executed 0 of 0 ERROR (0.002 secs / 0 secs)
--> onBrowserComplete 87250253 // suites is Object
--> onRunComplete
Chrome 34.0.1847 (Mac OS X 10.9.2): Executed 0 of 0 ERROR (0.004 secs / 0 secs)
--> onBrowserComplete 87250253 // suites is null
--> onRunComplete
Issue Analytics
- State:
- Created 9 years ago
- Comments:12 (1 by maintainers)
Top Results From Across the Web
Uncaught TypeError: Cannot read property of null - iDiallo
It says it cannot set property disabled of null. Where is disabled used? They are the elements with id btConsulta, btDescargar and btHist....
Read more >Uncaught TypeError: Cannot read property 'value' of null
I'm getting error in this code, I'm trying to do an event where in when the page is load, it will do the...
Read more >Intermittent test suite failures, TypeError: Cannot read property ...
When a test fails because of a "TypeError: Object #<Sockit> has no method ... Cannot read property 'deleteSession' of null" failure pattern, ...
Read more >cannot read property of null angular unit testing - You.com
When writing unit tests for Angular components, you may encounter the "Cannot read property 'xxx' of null" TypeError. This is usually caused by...
Read more >[SOLVED] Cannot Read Property 'addEventListener' of Null in ...
To fix the “cannot read property 'addEventListener' of null” error, make sure the selector used the access the element is properly defined.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@muhammad-ammar We ‘fixed’ this locally in our case but it took code changes to karma-junit-reporter. (I say ‘fixed’ because we did not address the underlying bug - we just made it work despite that).
I don’t have the code changes handy but our workaround looked very much like the one in @alexeibs’s fork here: https://github.com/Megaputer/karma-junit-reporter/commit/d14b9bffe0d3d658b8a99e2854b3e8070e50c11f and here: https://github.com/Megaputer/karma-junit-reporter/commit/9138c062c343262bccaa71571aca30d6e11d579b). You may want to try that for now.
This error should be fixed in the karma-junit-reporter 1.2.0 release.