nothing under Summary tab

Questions, problems, suggestions, bug reports, and so on.
Post Reply
arun

nothing under Summary tab

Post by arun » 2009-01-26 11:58 pm

Hi,
If i have a seperate js file and i specify its location in html source, like <script type="text/javascript" src="script.js"></script>, i get script.js under Summary tab.

But if I have javascript code in HTML source only, like <script type="text/javascript">code....
code....
code....
</script>,
there is nothing under Summary tab then. Why is it so?

Ed
Posts: 120
Joined: 2008-10-11 6:52 pm

Re: nothing under Summary tab

Post by Ed » 2009-01-27 12:21 am

Currently jscoverage does not parse and instrument HTML files, so any inline JavaScript in HTML will not be instrumented. (The code will still work; it just won't be included in code coverage statistics.)

arun

Re: nothing under Summary tab

Post by arun » 2009-01-27 5:46 am

So what all files can i get parsed.
What if the files are not local? Suppose I am trying to find the code coverage of a website which has javascript embedded in the source code of few pages. Do I have limitations then also on the files?

What files can I then get parsed?

Ed
Posts: 120
Joined: 2008-10-11 6:52 pm

Re: nothing under Summary tab

Post by Ed » 2009-01-27 5:58 am

It is basically the same - if the files are local, jscoverage parses only files ending in ".js"; if the files are coming from a remote server (i.e., with jscoverage-server --proxy), only files with HTTP Content-Type of "text/javascript" or "application/javascript" are parsed. HTML is never parsed.

arun

Re: nothing under Summary tab

Post by arun » 2009-01-27 9:34 am

Ok. Thanks.
This info pushed me to use it for some website.

I did this.
1. Opened command prompt.
2. Changed the proxy with address 127.0.0.1 and port 8080.
3. Typed jscoverage-server --verbose --proxy.
4. Opened this - http://shop.mcafee.com/jscoverage.html.

Its going to an error page, Why is it so?

Ed
Posts: 120
Joined: 2008-10-11 6:52 pm

Re: nothing under Summary tab

Post by Ed » 2009-01-27 4:10 pm

Looking at http://shop.mcafee.com/, it looks like some of their JavaScripts are mixing character sets - that may be confusing jscoverage-server. It might be better to run it like this:

Code: Select all

jscoverage-server --verbose --proxy --encoding=utf-8
But I'm not sure if that's your problem. When you run jscoverage-server with the --verbose option (as shown above), you should be getting a message in the console (command prompt) for each HTTP request made. When I do it, it looks like this:

Code: Select all

GET http://shop.mcafee.com/jscoverage.html HTTP/1.1
GET http://shop.mcafee.com/jscoverage-highlight.css HTTP/1.1
GET http://shop.mcafee.com/jscoverage.css HTTP/1.1
GET http://shop.mcafee.com/jscoverage.js HTTP/1.1
GET http://shop.mcafee.com/jscoverage-throbber.gif HTTP/1.1
Are you getting those messages?

Post Reply